// RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -path-equivalence=/tmp,%S %s | FileCheck -check-prefixes=SHARED,ALL %s // RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -path-equivalence=/tmp,%S -name=_Z4funcIbEiT_ %s | FileCheck -check-prefixes=SHARED,FILTER %s // before coverage // ALL: [[@LINE]]| |// before // FILTER-NOT:[[@LINE-1]]| |// before template // ALL: [[@LINE]]| |template int func(T x) { // ALL-NEXT: [[@LINE]]| 2|int func(T x) { if(x) // ALL-NEXT: [[@LINE]]| 2| if(x) return 0; // ALL-NEXT: [[@LINE]]| 1| return 0; else // ALL-NEXT: [[@LINE]]| 1| else return 1; // ALL-NEXT: [[@LINE]]| 1| return 1; int j = 1; // ALL-NEXT: [[@LINE]]| 0| int j = 1; } // ALL-NEXT: [[@LINE]]| 0|} // ALL: _Z4{{[a-z]+}}IiEiT_: // FILTER-NOT: _Z4{{[a-z]+}}IiEiT_: // ALL: [[@LINE-10]]| 1|int func(T x) { // ALL-NEXT: [[@LINE-10]]| 1| if(x) // ALL-NEXT: [[@LINE-10]]| 0| return 0; // ALL-NEXT: [[@LINE-10]]| 1| else // ALL-NEXT: [[@LINE-10]]| 1| return 1; // ALL-NEXT: [[@LINE-10]]| 0| int j = 1; // ALL-NEXT: [[@LINE-10]]| 0|} // SHARED: {{^ *(\| )?}}_Z4funcIbEiT_: // SHARED: [[@LINE-19]]| 1|int func(T x) { // SHARED-NEXT: [[@LINE-19]]| 1| if(x) // SHARED-NEXT: [[@LINE-19]]| 1| return 0; // SHARED-NEXT: [[@LINE-19]]| 0| else // SHARED-NEXT: [[@LINE-19]]| 0| return 1; // SHARED-NEXT: [[@LINE-19]]| 0| int j = 1; // SHARED-NEXT: [[@LINE-19]]| 0|} int main() { // ALL: [[@LINE]]| 1|int main() { func(0); // ALL-NEXT: [[@LINE]]| 1| func(0); func(true); // ALL-NEXT: [[@LINE]]| 1| func(true); return 0; // ALL-NEXT: [[@LINE]]| 1| return 0; } // ALL-NEXT: [[@LINE]]| 1|} // after coverage // ALL-NEXT: [[@LINE]]| |// after // FILTER-NOT:[[@LINE-1]]| |// after // Test html output. // RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -path-equivalence=/tmp,%S %s -format html -o %t.html.dir // RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -path-equivalence=/tmp,%S -name=_Z4funcIbEiT_ %s -format html -o %t.html.filtered.dir // RUN: FileCheck -check-prefixes=HTML-SHARED,HTML-ALL -input-file=%t.html.dir/coverage/tmp/showTemplateInstantiations.cpp.html %s // RUN: FileCheck -check-prefixes=HTML-SHARED,HTML-FILTER -input-file=%t.html.filtered.dir/coverage/tmp/showTemplateInstantiations.cpp.html %s // HTML-ALL:
4
// before
// HTML-FILTER-NOT: 
4
// before
// HTML-ALL: 
6
template<typename T>

// HTML-ALL: 
_Z4funcIiEiT_
// HTML-FILTER-NOT:
_Z4funcIiEiT_
// HTML-ALL:
7
1
int func(T x) {

// HTML-SHARED: 
_Z4funcIbEiT_
// HTML-SHARED:
7
1
int func(T x) {

// RUN: FileCheck -check-prefix=HTML-JUMP -input-file=%t.html.dir/coverage/tmp/showTemplateInstantiations.cpp.html %s
// HTML-JUMP: 
Source (jump to first uncovered line)
// HTML-JUMP-NOT:
Source (jump to first uncovered line)
// RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -show-instantiations=false -path-equivalence=/tmp,%S %s | FileCheck -check-prefix=NO_INSTS %s // NO_INSTS-NOT: {{^ *}}| _Z4funcIbEiT_: // NO_INSTS-NOT: {{^ *}}| _Z4funcIiEiT_: // RUN: llvm-cov report %S/Inputs/templateInstantiations.covmapping -dump -instr-profile %S/Inputs/templateInstantiations.profdata -path-equivalence=/tmp,%S %s | FileCheck -check-prefix=DUMP %s // DUMP: InstantiationGroup: Definition at line 7, column 15 with size = 2 // DUMP: InstantiationGroup: main with size = 1