Vedant Kumar | c1561cb | 2016-06-29 17:47:08 +0000 | [diff] [blame] | 1 | // 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 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; |
| 10 | else // ALL-NEXT: [[@LINE]]| 2| else |
| 11 | return 1; // ALL-NEXT: [[@LINE]]| 1| return 1; |
| 12 | int j = 1; // ALL-NEXT: [[@LINE]]| 0| int j = 1; |
| 13 | } // ALL-NEXT: [[@LINE]]| 2|} |
Justin Bogner | b35a72a | 2014-09-25 00:34:18 +0000 | [diff] [blame] | 14 | |
Ying Yi | 24e91bd | 2016-09-06 21:41:38 +0000 | [diff] [blame] | 15 | // SHARED: {{^ *(\| )?}}Function: _Z4funcIbEiT_: |
Ying Yi | 84dc971 | 2016-08-24 14:27:23 +0000 | [diff] [blame] | 16 | // SHARED: [[@LINE-9]]| 1|int func(T x) { |
Ying Yi | 6b1f5f8 | 2016-08-09 19:53:35 +0000 | [diff] [blame] | 17 | // SHARED-NEXT: [[@LINE-9]]| 1| if(x) |
| 18 | // SHARED-NEXT: [[@LINE-9]]| 1| return 0; |
| 19 | // SHARED-NEXT: [[@LINE-9]]| 1| else |
| 20 | // SHARED-NEXT: [[@LINE-9]]| 0| return 1; |
| 21 | // SHARED-NEXT: [[@LINE-9]]| 0| int j = 1; |
| 22 | // SHARED-NEXT: [[@LINE-9]]| 1|} |
Justin Bogner | b35a72a | 2014-09-25 00:34:18 +0000 | [diff] [blame] | 23 | |
Ying Yi | 24e91bd | 2016-09-06 21:41:38 +0000 | [diff] [blame] | 24 | // ALL: {{^ *}}| Function: _Z4funcIiEiT_: |
| 25 | // FILTER-NOT: {{^ *(\| )?}}Function: _Z4funcIiEiT_: |
Ying Yi | 84dc971 | 2016-08-24 14:27:23 +0000 | [diff] [blame] | 26 | // ALL: [[@LINE-19]]| 1|int func(T x) { |
Ying Yi | 6b1f5f8 | 2016-08-09 19:53:35 +0000 | [diff] [blame] | 27 | // ALL-NEXT: [[@LINE-19]]| 1| if(x) |
| 28 | // ALL-NEXT: [[@LINE-19]]| 0| return 0; |
| 29 | // ALL-NEXT: [[@LINE-19]]| 1| else |
| 30 | // ALL-NEXT: [[@LINE-19]]| 1| return 1; |
| 31 | // ALL-NEXT: [[@LINE-19]]| 0| int j = 1; |
| 32 | // ALL-NEXT: [[@LINE-19]]| 1|} |
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. |
| 43 | // RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -filename-equivalence %s -format html -o %t.html.dir |
| 44 | // 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 |
| 45 | // RUN: FileCheck -check-prefixes=HTML-SHARED,HTML-ALL -input-file=%t.html.dir/coverage/tmp/showTemplateInstantiations.cpp.html %s |
| 46 | // RUN: FileCheck -check-prefixes=HTML-SHARED,HTML-FILTER -input-file=%t.html.dir/functions.html %s |
| 47 | |
Ying Yi | 6b1f5f8 | 2016-08-09 19:53:35 +0000 | [diff] [blame] | 48 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='uncovered-line'></td><td class='code'><pre>// before |
| 49 | // HTML-FILTER-NOT: <td class='line-number'><a name='L[[@LINE-45]]'><pre>[[@LINE-45]]</pre></a></td><td class='uncovered-line'></td><td class='code'><pre>// before |
| 50 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='uncovered-line'></td><td class='code'><pre>template<typename T> |
| 51 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>2</pre></td><td class='code'><pre>int func(T x) { |
| 52 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>2</pre></td><td class='code'><pre> if(x) |
| 53 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre> ret |
| 54 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>2</pre></td><td class='code'><pre> else |
| 55 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre> ret |
| 56 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='uncovered-line'><pre>0</pre></td><td class='code'><pre> |
| 57 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>2</pre></td><td class='code'><pre>} |
Vedant Kumar | 4c01092 | 2016-07-06 21:44:05 +0000 | [diff] [blame] | 58 | |
Ying Yi | 84dc971 | 2016-08-24 14:27:23 +0000 | [diff] [blame] | 59 | // HTML-SHARED: <div class='source-name-title'><pre>Function: _Z4funcIbEiT_</pre></div> |
Ying Yi | 6b1f5f8 | 2016-08-09 19:53:35 +0000 | [diff] [blame] | 60 | // HTML-SHARED: <td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre>int func(T x) { |
| 61 | // HTML-SHARED: <td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre> if(x) |
| 62 | // HTML-SHARED: <td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre> ret |
| 63 | // HTML-SHARED: <td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre> else |
| 64 | // HTML-SHARED: <td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='uncovered-line'><pre>0</pre></td><td class='code'><pre> |
| 65 | // HTML-SHARED: <td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='uncovered-line'><pre>0</pre></td><td class='code'><pre> |
| 66 | // HTML-SHARED: <td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre>} |
Vedant Kumar | 4c01092 | 2016-07-06 21:44:05 +0000 | [diff] [blame] | 67 | |
Ying Yi | 84dc971 | 2016-08-24 14:27:23 +0000 | [diff] [blame] | 68 | // HTML-ALL: <div class='source-name-title'><pre>Function: _Z4funcIiEiT_</pre></div> |
Vedant Kumar | 4c01092 | 2016-07-06 21:44:05 +0000 | [diff] [blame] | 69 | // HTML-FILTER-NOT: <div class='source-name-title'><pre>_Z4funcIiEiT_</pre></div><table> |
Ying Yi | 6b1f5f8 | 2016-08-09 19:53:35 +0000 | [diff] [blame] | 70 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-63]]'><pre>[[@LINE-63]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre>int func(T x) { |
| 71 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-63]]'><pre>[[@LINE-63]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre> if(x) |
| 72 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-63]]'><pre>[[@LINE-63]]</pre></a></td><td class='uncovered-line'><pre>0</pre></td><td class='code'><pre> |
| 73 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-63]]'><pre>[[@LINE-63]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre> else |
| 74 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-63]]'><pre>[[@LINE-63]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre> ret |
| 75 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-63]]'><pre>[[@LINE-63]]</pre></a></td><td class='uncovered-line'><pre>0</pre></td><td class='code'><pre> |
| 76 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-63]]'><pre>[[@LINE-63]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre>} |
Vedant Kumar | 4c01092 | 2016-07-06 21:44:05 +0000 | [diff] [blame] | 77 | |
Ying Yi | 6b1f5f8 | 2016-08-09 19:53:35 +0000 | [diff] [blame] | 78 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre>int main() { |
| 79 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre> func<int>(0); |
| 80 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre> func<bool>(true); |
| 81 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre> return 0; |
| 82 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>1</pre></td><td class='code'><pre>} |
Vedant Kumar | 4c01092 | 2016-07-06 21:44:05 +0000 | [diff] [blame] | 83 | |
Ying Yi | 6b1f5f8 | 2016-08-09 19:53:35 +0000 | [diff] [blame] | 84 | // HTML-ALL: <td class='line-number'><a name='L[[@LINE-45]]'><pre>[[@LINE-45]]</pre></a></td><td class='uncovered-line'></td><td class='code'><pre>// after |
| 85 | // HTML-FILTER-NOT: <td class='line-number'><a name='L[[@LINE-46]]'><pre>[[@LINE-46]]</pre></a></td><td class='uncovered-line'></td><td class='code'><pre>// after |