1 // RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -filename-equivalence %s | FileCheck -check-prefix=CHECK -check-prefix=ALL %s
2 // RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -filename-equivalence -name=_Z4funcIbEiT_ %s | FileCheck -check-prefix=CHECK -check-prefix=FILTER %s
3
4 // before coverage // WHOLE-FILE: | [[@LINE]]|// before
5 // FILTER-NOT: | [[@LINE-1]]|// before
6 template<typename T> // ALL: | [[@LINE]]|template<typename T>
func(T x)7 int func(T x) { // ALL-NEXT: 2| [[@LINE]]|int func(T x) {
8 if(x) // ALL-NEXT: 2| [[@LINE]]| if(x)
9 return 0; // ALL-NEXT: 1| [[@LINE]]| return 0;
10 else // ALL-NEXT: 1| [[@LINE]]| else
11 return 1; // ALL-NEXT: 1| [[@LINE]]| return 1;
12 int j = 1; // ALL-NEXT: 0| [[@LINE]]| int j = 1;
13 } // ALL-NEXT: 1| [[@LINE]]|}
14
15 // CHECK: {{^ *(\| )?}}_Z4funcIbEiT_:
16 // CHECK-NEXT: 1| [[@LINE-9]]|int func(T x) {
17 // CHECK-NEXT: 1| [[@LINE-9]]| if(x)
18 // CHECK-NEXT: 1| [[@LINE-9]]| return 0;
19 // CHECK-NEXT: 1| [[@LINE-9]]| else
20 // CHECK-NEXT: 0| [[@LINE-9]]| return 1;
21 // CHECK-NEXT: 0| [[@LINE-9]]| int j = 1;
22 // CHECK-NEXT: 1| [[@LINE-9]]|}
23
24 // ALL: {{^ *}}| _Z4funcIiEiT_:
25 // FILTER-NOT: {{^ *(\| )?}} _Z4funcIiEiT_:
26 // ALL-NEXT: 1| [[@LINE-19]]|int func(T x) {
27 // ALL-NEXT: 1| [[@LINE-19]]| if(x)
28 // ALL-NEXT: 0| [[@LINE-19]]| return 0;
29 // ALL-NEXT: 1| [[@LINE-19]]| else
30 // ALL-NEXT: 1| [[@LINE-19]]| return 1;
31 // ALL-NEXT: 0| [[@LINE-19]]| int j = 1;
32 // ALL-NEXT: 1| [[@LINE-19]]|}
33
main()34 int main() { // ALL: 1| [[@LINE]]|int main() {
35 func<int>(0); // ALL-NEXT: 1| [[@LINE]]| func<int>(0);
36 func<bool>(true); // ALL-NEXT: 1| [[@LINE]]| func<bool>(true);
37 return 0; // ALL-NEXT: 1| [[@LINE]]| return 0;
38 } // ALL-NEXT: 1| [[@LINE]]|}
39 // after coverage // ALL-NEXT: | [[@LINE]]|// after
40 // FILTER-NOT: | [[@LINE-1]]|// after
41