// 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: 2| [[@LINE]]|int func(T x) { if(x) // ALL-NEXT: 2| [[@LINE]]| if(x) return 0; // ALL-NEXT: 1| [[@LINE]]| return 0; else // ALL-NEXT: 2| [[@LINE]]| else return 1; // ALL-NEXT: 1| [[@LINE]]| return 1; int j = 1; // ALL-NEXT: 0| [[@LINE]]| int j = 1; } // ALL-NEXT: 2| [[@LINE]]|} // SHARED: {{^ *(\| )?}}_Z4funcIbEiT_: // SHARED-NEXT: 1| [[@LINE-9]]|int func(T x) { // SHARED-NEXT: 1| [[@LINE-9]]| if(x) // SHARED-NEXT: 1| [[@LINE-9]]| return 0; // SHARED-NEXT: 1| [[@LINE-9]]| else // SHARED-NEXT: 0| [[@LINE-9]]| return 1; // SHARED-NEXT: 0| [[@LINE-9]]| int j = 1; // SHARED-NEXT: 1| [[@LINE-9]]|} // ALL: {{^ *}}| _Z4funcIiEiT_: // FILTER-NOT: {{^ *(\| )?}} _Z4funcIiEiT_: // ALL-NEXT: 1| [[@LINE-19]]|int func(T x) { // ALL-NEXT: 1| [[@LINE-19]]| if(x) // ALL-NEXT: 0| [[@LINE-19]]| return 0; // ALL-NEXT: 1| [[@LINE-19]]| else // ALL-NEXT: 1| [[@LINE-19]]| return 1; // ALL-NEXT: 0| [[@LINE-19]]| int j = 1; // ALL-NEXT: 1| [[@LINE-19]]|} int main() { // ALL: 1| [[@LINE]]|int main() { func(0); // ALL-NEXT: 1| [[@LINE]]| func(0); func(true); // ALL-NEXT: 1| [[@LINE]]| func(true); return 0; // ALL-NEXT: 1| [[@LINE]]| return 0; } // ALL-NEXT: 1| [[@LINE]]|} // 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: 
2
[[@LINE-44]]
int func(T x) {
// HTML-ALL: 
2
[[@LINE-44]]
  if(x)
// HTML-ALL: 
1
[[@LINE-44]]
    ret
// HTML-ALL: 
2
[[@LINE-44]]
  else
// HTML-ALL: 
1
[[@LINE-44]]
    ret
// HTML-ALL: 
0
[[@LINE-44]]
// HTML-ALL: 
2
[[@LINE-44]]
}

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

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

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

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