// RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -filename-equivalence %s | FileCheck -check-prefixes=SHARED,ALL %s // RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -filename-equivalence -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]]| 2| else return 1; // ALL-NEXT: [[@LINE]]| 1| return 1; int j = 1; // ALL-NEXT: [[@LINE]]| 0| int j = 1; } // ALL-NEXT: [[@LINE]]| 2|} // SHARED: {{^ *(\| )?}}_Z4funcIbEiT_: // SHARED: [[@LINE-9]]| 1|int func(T x) { // SHARED-NEXT: [[@LINE-9]]| 1| if(x) // SHARED-NEXT: [[@LINE-9]]| 1| return 0; // SHARED-NEXT: [[@LINE-9]]| 1| else // SHARED-NEXT: [[@LINE-9]]| 0| return 1; // SHARED-NEXT: [[@LINE-9]]| 0| int j = 1; // SHARED-NEXT: [[@LINE-9]]| 1|} // ALL: {{^ *}}| _Z4funcIiEiT_: // FILTER-NOT: {{^ *(\| )?}} _Z4funcIiEiT_: // ALL: [[@LINE-19]]| 1|int func(T x) { // ALL-NEXT: [[@LINE-19]]| 1| if(x) // ALL-NEXT: [[@LINE-19]]| 0| return 0; // ALL-NEXT: [[@LINE-19]]| 1| else // ALL-NEXT: [[@LINE-19]]| 1| return 1; // ALL-NEXT: [[@LINE-19]]| 0| int j = 1; // ALL-NEXT: [[@LINE-19]]| 1|} 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 -filename-equivalence %s -format html -o %t.html.dir // RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -filename-equivalence -name=_Z4funcIbEiT_ %s -format html -o %t.html.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.dir/functions.html %s // HTML-ALL:
[[@LINE-44]]
// before
// HTML-FILTER-NOT: 
[[@LINE-45]]
// before
// HTML-ALL: 
[[@LINE-44]]
template<typename T>
// HTML-ALL: 
[[@LINE-44]]
2
int func(T x) {
// HTML-ALL: 
[[@LINE-44]]
2
  if(x)
// HTML-ALL: 
[[@LINE-44]]
1
    ret
// HTML-ALL: 
[[@LINE-44]]
2
  else
// HTML-ALL: 
[[@LINE-44]]
1
    ret
// HTML-ALL: 
[[@LINE-44]]
0
// HTML-ALL: 
[[@LINE-44]]
2
}

// HTML-SHARED: 
_Z4funcIbEiT_
// HTML-SHARED:
[[@LINE-53]]
1
int func(T x) {
// HTML-SHARED: 
[[@LINE-53]]
1
  if(x)
// HTML-SHARED: 
[[@LINE-53]]
1
    ret
// HTML-SHARED: 
[[@LINE-53]]
1
  else
// HTML-SHARED: 
[[@LINE-53]]
0
// HTML-SHARED: 
[[@LINE-53]]
0
// HTML-SHARED: 
[[@LINE-53]]
1
}

// HTML-ALL: 
_Z4funcIiEiT_
// HTML-FILTER-NOT:
_Z4funcIiEiT_
// HTML-ALL:
[[@LINE-63]]
1
int func(T x) {
// HTML-ALL: 
[[@LINE-63]]
1
  if(x)
// HTML-ALL: 
[[@LINE-63]]
0
// HTML-ALL: 
[[@LINE-63]]
1
  else
// HTML-ALL: 
[[@LINE-63]]
1
    ret
// HTML-ALL: 
[[@LINE-63]]
0
// HTML-ALL: 
[[@LINE-63]]
1
}

// HTML-ALL: 
[[@LINE-44]]
1
int main() {
// HTML-ALL: 
[[@LINE-44]]
1
  func<int>(0);
// HTML-ALL: 
[[@LINE-44]]
1
  func<bool>(true);
// HTML-ALL: 
[[@LINE-44]]
1
  return 0;
// HTML-ALL: 
[[@LINE-44]]
1
}

// HTML-ALL: 
[[@LINE-45]]
// after
// HTML-FILTER-NOT: 
[[@LINE-46]]
// after

// 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)