blob: 77ecb4734000c8ca49b7a6ff19db11467e970e8d [file] [log] [blame]
Vedant Kumarc1561cb2016-06-29 17:47:08 +00001// RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -filename-equivalence %s | FileCheck -check-prefixes=SHARED,ALL %s
2// 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
Justin Bognerb35a72a2014-09-25 00:34:18 +00003
Vedant Kumarcae1cff2016-06-22 23:58:03 +00004// before coverage // ALL: | [[@LINE]]|// before
Justin Bognerb35a72a2014-09-25 00:34:18 +00005 // FILTER-NOT: | [[@LINE-1]]|// before
6template<typename T> // ALL: | [[@LINE]]|template<typename T>
7int 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;
Igor Kudrined99a962016-04-25 09:43:37 +000010 else // ALL-NEXT: 2| [[@LINE]]| else
Justin Bognerb35a72a2014-09-25 00:34:18 +000011 return 1; // ALL-NEXT: 1| [[@LINE]]| return 1;
12 int j = 1; // ALL-NEXT: 0| [[@LINE]]| int j = 1;
Igor Kudrined99a962016-04-25 09:43:37 +000013} // ALL-NEXT: 2| [[@LINE]]|}
Justin Bognerb35a72a2014-09-25 00:34:18 +000014
Vedant Kumarc1561cb2016-06-29 17:47:08 +000015 // SHARED: {{^ *(\| )?}}_Z4funcIbEiT_:
16 // SHARED-NEXT: 1| [[@LINE-9]]|int func(T x) {
17 // SHARED-NEXT: 1| [[@LINE-9]]| if(x)
18 // SHARED-NEXT: 1| [[@LINE-9]]| return 0;
19 // SHARED-NEXT: 1| [[@LINE-9]]| else
20 // SHARED-NEXT: 0| [[@LINE-9]]| return 1;
21 // SHARED-NEXT: 0| [[@LINE-9]]| int j = 1;
22 // SHARED-NEXT: 1| [[@LINE-9]]|}
Justin Bognerb35a72a2014-09-25 00:34:18 +000023
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
34int 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