Sean Eveson | 9edfeac | 2017-08-14 10:20:12 +0000 | [diff] [blame] | 1 | // 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 |
| 2 | // 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 |
Justin Bogner | b35a72a | 2014-09-25 00:34:18 +0000 | [diff] [blame] | 3 | |
Ying Yi | 6b1f5f8 | 2016-08-09 19:53:35 +0000 | [diff] [blame] | 4 | // before coverage // ALL: [[@LINE]]| |// before |
| 5 | // FILTER-NOT:[[@LINE-1]]| |// before |
| 6 | template<typename T> // ALL: [[@LINE]]| |template<typename T> |
| 7 | int func(T x) { // ALL-NEXT: [[@LINE]]| 2|int func(T x) { |
| 8 | if(x) // ALL-NEXT: [[@LINE]]| 2| if(x) |
| 9 | return 0; // ALL-NEXT: [[@LINE]]| 1| return 0; |
Vedant Kumar | 43247f0 | 2017-11-09 02:33:43 +0000 | [diff] [blame] | 10 | else // ALL-NEXT: [[@LINE]]| 1| else |
Ying Yi | 6b1f5f8 | 2016-08-09 19:53:35 +0000 | [diff] [blame] | 11 | return 1; // ALL-NEXT: [[@LINE]]| 1| return 1; |
| 12 | int j = 1; // ALL-NEXT: [[@LINE]]| 0| int j = 1; |
Vedant Kumar | 43247f0 | 2017-11-09 02:33:43 +0000 | [diff] [blame] | 13 | } // ALL-NEXT: [[@LINE]]| 0|} |
| 14 | |
| 15 | // ALL: _Z4{{[a-z]+}}IiEiT_: |
| 16 | // FILTER-NOT: _Z4{{[a-z]+}}IiEiT_: |
| 17 | // ALL: [[@LINE-10]]| 1|int func(T x) { |
| 18 | // ALL-NEXT: [[@LINE-10]]| 1| if(x) |
| 19 | // ALL-NEXT: [[@LINE-10]]| 0| return 0; |
| 20 | // ALL-NEXT: [[@LINE-10]]| 1| else |
| 21 | // ALL-NEXT: [[@LINE-10]]| 1| return 1; |
| 22 | // ALL-NEXT: [[@LINE-10]]| 0| int j = 1; |
| 23 | // ALL-NEXT: [[@LINE-10]]| 0|} |
Justin Bogner | b35a72a | 2014-09-25 00:34:18 +0000 | [diff] [blame] | 24 | |
Vedant Kumar | 0053c0b | 2016-09-08 00:56:48 +0000 | [diff] [blame] | 25 | // SHARED: {{^ *(\| )?}}_Z4funcIbEiT_: |
Vedant Kumar | 43247f0 | 2017-11-09 02:33:43 +0000 | [diff] [blame] | 26 | // SHARED: [[@LINE-19]]| 1|int func(T x) { |
| 27 | // SHARED-NEXT: [[@LINE-19]]| 1| if(x) |
| 28 | // SHARED-NEXT: [[@LINE-19]]| 1| return 0; |
| 29 | // SHARED-NEXT: [[@LINE-19]]| 0| else |
| 30 | // SHARED-NEXT: [[@LINE-19]]| 0| return 1; |
| 31 | // SHARED-NEXT: [[@LINE-19]]| 0| int j = 1; |
| 32 | // SHARED-NEXT: [[@LINE-19]]| 0|} |
Justin Bogner | b35a72a | 2014-09-25 00:34:18 +0000 | [diff] [blame] | 33 | |
Ying Yi | 6b1f5f8 | 2016-08-09 19:53:35 +0000 | [diff] [blame] | 34 | int main() { // ALL: [[@LINE]]| 1|int main() { |
| 35 | func<int>(0); // ALL-NEXT: [[@LINE]]| 1| func<int>(0); |
| 36 | func<bool>(true); // ALL-NEXT: [[@LINE]]| 1| func<bool>(true); |
| 37 | return 0; // ALL-NEXT: [[@LINE]]| 1| return 0; |
| 38 | } // ALL-NEXT: [[@LINE]]| 1|} |
| 39 | // after coverage // ALL-NEXT: [[@LINE]]| |// after |
| 40 | // FILTER-NOT:[[@LINE-1]]| |// after |
Vedant Kumar | 4c01092 | 2016-07-06 21:44:05 +0000 | [diff] [blame] | 41 | |
| 42 | // Test html output. |
Sean Eveson | 9edfeac | 2017-08-14 10:20:12 +0000 | [diff] [blame] | 43 | // 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 |
Sean Eveson | fa8ef35 | 2017-09-28 10:07:30 +0000 | [diff] [blame] | 44 | // 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 |
Vedant Kumar | 4c01092 | 2016-07-06 21:44:05 +0000 | [diff] [blame] | 45 | // RUN: FileCheck -check-prefixes=HTML-SHARED,HTML-ALL -input-file=%t.html.dir/coverage/tmp/showTemplateInstantiations.cpp.html %s |
Sean Eveson | fa8ef35 | 2017-09-28 10:07:30 +0000 | [diff] [blame] | 46 | // RUN: FileCheck -check-prefixes=HTML-SHARED,HTML-FILTER -input-file=%t.html.filtered.dir/coverage/tmp/showTemplateInstantiations.cpp.html %s |
Vedant Kumar | 4c01092 | 2016-07-06 21:44:05 +0000 | [diff] [blame] | 47 | |
Vedant Kumar | 43247f0 | 2017-11-09 02:33:43 +0000 | [diff] [blame] | 48 | // HTML-ALL: <td class='line-number'><a name='L4' href='#L4'><pre>4</pre></a></td><td class='uncovered-line'></td><td class='code'><pre>// before |
| 49 | // HTML-FILTER-NOT: <td class='line-number'><a name='L4' href='#L4'><pre>4</pre></a></td><td class='uncovered-line'></td><td class='code'><pre>// before |
| 50 | // HTML-ALL: <td class='line-number'><a name='L6' href='#L6'><pre>6</pre></a></td><td class='uncovered-line'></td><td class='code'><pre>template<typename T> |
Vedant Kumar | 4c01092 | 2016-07-06 21:44:05 +0000 | [diff] [blame] | 51 | |
Vedant Kumar | 0053c0b | 2016-09-08 00:56:48 +0000 | [diff] [blame] | 52 | // HTML-ALL: <div class='source-name-title'><pre>_Z4funcIiEiT_</pre></div> |
Vedant Kumar | 4c01092 | 2016-07-06 21:44:05 +0000 | [diff] [blame] | 53 | // HTML-FILTER-NOT: <div class='source-name-title'><pre>_Z4funcIiEiT_</pre></div><table> |
Vedant Kumar | 43247f0 | 2017-11-09 02:33:43 +0000 | [diff] [blame] | 54 | // HTML-ALL: <td class='line-number'><a name='L7' href='#L7'><pre>7</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre>int func(T x) { |
Vedant Kumar | 4c01092 | 2016-07-06 21:44:05 +0000 | [diff] [blame] | 55 | |
Vedant Kumar | 43247f0 | 2017-11-09 02:33:43 +0000 | [diff] [blame] | 56 | // HTML-SHARED: <div class='source-name-title'><pre>_Z4funcIbEiT_</pre></div> |
| 57 | // HTML-SHARED: <td class='line-number'><a name='L7' href='#L7'><pre>7</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre>int func(T x) { |
Vedant Kumar | ea1e97b | 2016-09-15 06:44:48 +0000 | [diff] [blame] | 58 | |
| 59 | // RUN: FileCheck -check-prefix=HTML-JUMP -input-file=%t.html.dir/coverage/tmp/showTemplateInstantiations.cpp.html %s |
| 60 | // HTML-JUMP: <pre>Source (<a href='#L{{[0-9]+}}'>jump to first uncovered line</a>)</pre> |
| 61 | // HTML-JUMP-NOT: <pre>Source (<a href='#L{{[0-9]+}}'>jump to first uncovered line</a>)</pre> |
Vedant Kumar | 79554e4 | 2017-08-02 23:35:24 +0000 | [diff] [blame] | 62 | |
Sean Eveson | 9edfeac | 2017-08-14 10:20:12 +0000 | [diff] [blame] | 63 | // 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 |
Vedant Kumar | 79554e4 | 2017-08-02 23:35:24 +0000 | [diff] [blame] | 64 | // NO_INSTS-NOT: {{^ *}}| _Z4funcIbEiT_: |
| 65 | // NO_INSTS-NOT: {{^ *}}| _Z4funcIiEiT_: |
Vedant Kumar | 72c3a11 | 2017-09-08 18:44:49 +0000 | [diff] [blame] | 66 | |
| 67 | // 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 |
Vedant Kumar | 43247f0 | 2017-11-09 02:33:43 +0000 | [diff] [blame] | 68 | // DUMP: InstantiationGroup: Definition at line 7, column 15 with size = 2 |
Vedant Kumar | 72c3a11 | 2017-09-08 18:44:49 +0000 | [diff] [blame] | 69 | // DUMP: InstantiationGroup: main with size = 1 |