[llvm-cov] Swapped the line and count columns.

In the coverage report, the line and count columns have been swapped to make it more readable.
A follow-up commit in compiler-rt is needed

Differential Revision: https://reviews.llvm.org/D23281

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278152 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ying Yi 2016-08-09 19:53:35 +00:00
parent bf1a5ce9bf
commit 17a2f3f28e
8 changed files with 142 additions and 142 deletions

View File

@ -8,14 +8,14 @@ private:
T t;
};
template <class T> T FOO<T>::DoIt(T ti) { // HEADER: 2| [[@LINE]]|template
for (T I = 0; I < ti; I++) { // HEADER: 22| [[@LINE]]| for (T
t += I; // HEADER: 20| [[@LINE]]| t += I;
if (I > ti / 2) // HEADER: 20| [[@LINE]]| if (I > ti
t -= 1; // HEADER: 8| [[@LINE]]| t -= 1;
} // HEADER: 20| [[@LINE]]| }
// HEADER: 2| [[@LINE]]|
return t; // HEADER: 2| [[@LINE]]| return t;
template <class T> T FOO<T>::DoIt(T ti) { // HEADER: [[@LINE]]| 2|template
for (T I = 0; I < ti; I++) { // HEADER: [[@LINE]]| 22| for (T
t += I; // HEADER: [[@LINE]]| 20| t += I;
if (I > ti / 2) // HEADER: [[@LINE]]| 20| if (I > ti
t -= 1; // HEADER: [[@LINE]]| 8| t -= 1;
} // HEADER: [[@LINE]]| 20| }
// HEADER: [[@LINE]]| 2|
return t; // HEADER: [[@LINE]]| 2| return t;
}
// To generate the binaries which correspond to this file, you must first

View File

@ -1,6 +1,6 @@
// Checks for reading various formats.
// CHECK: 100| [[@LINE+1]]|int main
// CHECK: [[@LINE+1]]| 100|int main
int main(int argc, const char *argv[]) {}
// RUN: llvm-profdata merge %S/Inputs/binary-formats.proftext -o %t.profdata

View File

@ -5,22 +5,22 @@
#define SIMPLE_OP \
++x
// CHECK: | [[@LINE-2]]|#define SIMPLE_OP
// CHECK-NEXT: 2| [[@LINE-2]]| ++x
// CHECK: [[@LINE-2]]| |#define SIMPLE_OP
// CHECK-NEXT: [[@LINE-2]]| 2| ++x
#define DO_SOMETHING \
{ \
int x = 0; \
SIMPLE_OP; \
}
// CHECK: | [[@LINE-5]]|#define DO_SOMETHING
// CHECK-NEXT: 2| [[@LINE-5]]| {
// CHECK-NEXT: 2| [[@LINE-5]]| int x = 0;
// CHECK-NEXT: 2| [[@LINE-5]]| SIMPLE_OP;
// CHECK-NEXT: 2| [[@LINE-5]]| }
// CHECK: [[@LINE-5]]| |#define DO_SOMETHING
// CHECK-NEXT: [[@LINE-5]]| 2| {
// CHECK-NEXT: [[@LINE-5]]| 2| int x = 0;
// CHECK-NEXT: [[@LINE-5]]| 2| SIMPLE_OP;
// CHECK-NEXT: [[@LINE-5]]| 2| }
int main() { // CHECK: 1| [[@LINE]]|int main() {
DO_SOMETHING; // CHECK-NEXT: 1| [[@LINE]]| DO_SOMETHING;
DO_SOMETHING; // CHECK-NEXT: 1| [[@LINE]]| DO_SOMETHING;
return 0; // CHECK-NEXT: 1| [[@LINE]]| return 0;
} // CHECK-NEXT: 1| [[@LINE]]|}
int main() { // CHECK: [[@LINE]]| 1|int main() {
DO_SOMETHING; // CHECK-NEXT: [[@LINE]]| 1| DO_SOMETHING;
DO_SOMETHING; // CHECK-NEXT: [[@LINE]]| 1| DO_SOMETHING;
return 0; // CHECK-NEXT: [[@LINE]]| 1| return 0;
} // CHECK-NEXT: [[@LINE]]| 1|}

View File

@ -12,13 +12,13 @@
// RUN: llvm-cov show %S/Inputs/prefer_used_to_unused.covmapping -instr-profile %t.profdata -filename-equivalence %s | FileCheck %s
// Coverage data for this function has a non-zero hash value if it is used in the translation unit.
inline int sampleFunc(int A) { // CHECK: 1| [[@LINE]]|inline int sampleFunc(int A) {
if (A > 0) // CHECK-NEXT: 1| [[@LINE]]| if (A > 0)
return A; // CHECK-NEXT: 1| [[@LINE]]| return A;
return 0; // CHECK-NEXT: 0| [[@LINE]]| return 0;
} // CHECK-NEXT: 1| [[@LINE]]|}
inline int sampleFunc(int A) { // CHECK: [[@LINE]]| 1|inline int sampleFunc(int A) {
if (A > 0) // CHECK-NEXT: [[@LINE]]| 1| if (A > 0)
return A; // CHECK-NEXT: [[@LINE]]| 1| return A;
return 0; // CHECK-NEXT: [[@LINE]]| 0| return 0;
} // CHECK-NEXT: [[@LINE]]| 1|}
// The hash for this function is zero in both cases, either it is used in the translation unit or not.
inline int simpleFunc(int A) { // CHECK: 1| [[@LINE]]|inline int simpleFunc(int A) {
return A; // CHECK-NEXT: 1| [[@LINE]]| return A;
} // CHECK-NEXT: 1| [[@LINE]]|}
inline int simpleFunc(int A) { // CHECK: [[@LINE]]| 1|inline int simpleFunc(int A) {
return A; // CHECK-NEXT: [[@LINE]]| 1| return A;
} // CHECK-NEXT: [[@LINE]]| 1|}

View File

@ -1,30 +1,30 @@
// Basic handling of line counts.
// RUN: llvm-profdata merge %S/Inputs/lineExecutionCounts.proftext -o %t.profdata
// before any coverage // WHOLE-FILE: | [[@LINE]]|// before
// FILTER-NOT: | [[@LINE-1]]|// before
int main() { // TEXT: 161| [[@LINE]]|int main(
int x = 0; // TEXT: 161| [[@LINE]]| int x
// TEXT: 161| [[@LINE]]|
if (x) { // TEXT: 0| [[@LINE]]| if (x)
x = 0; // TEXT: 0| [[@LINE]]| x = 0
} else { // TEXT: 161| [[@LINE]]| } else
x = 1; // TEXT: 161| [[@LINE]]| x = 1
} // TEXT: 161| [[@LINE]]| }
// TEXT: 161| [[@LINE]]|
for (int i = 0; i < 100; ++i) { // TEXT: 16.2k| [[@LINE]]| for (
x = 1; // TEXT: 16.1k| [[@LINE]]| x = 1
} // TEXT: 16.1k| [[@LINE]]| }
// TEXT: 161| [[@LINE]]|
x = x < 10 ? x + 1 : x - 1; // TEXT: 161| [[@LINE]]| x =
x = x > 10 ? // TEXT: 161| [[@LINE]]| x =
x - 1: // TEXT: 0| [[@LINE]]| x
x + 1; // TEXT: 161| [[@LINE]]| x
// TEXT: 161| [[@LINE]]|
return 0; // TEXT: 161| [[@LINE]]| return
} // TEXT: 161| [[@LINE]]|}
// after coverage // WHOLE-FILE: | [[@LINE]]|// after
// FILTER-NOT: | [[@LINE-1]]|// after
// before any coverage // WHOLE-FILE: [[@LINE]]| |// before
// FILTER-NOT: [[@LINE-1]]| |// before
int main() { // TEXT: [[@LINE]]| 161|int main(
int x = 0; // TEXT: [[@LINE]]| 161| int x
// TEXT: [[@LINE]]| 161|
if (x) { // TEXT: [[@LINE]]| 0| if (x)
x = 0; // TEXT: [[@LINE]]| 0| x = 0
} else { // TEXT: [[@LINE]]| 161| } else
x = 1; // TEXT: [[@LINE]]| 161| x = 1
} // TEXT: [[@LINE]]| 161| }
// TEXT: [[@LINE]]| 161|
for (int i = 0; i < 100; ++i) { // TEXT: [[@LINE]]| 16.2k| for (
x = 1; // TEXT: [[@LINE]]| 16.1k| x = 1
} // TEXT: [[@LINE]]| 16.1k| }
// TEXT: [[@LINE]]| 161|
x = x < 10 ? x + 1 : x - 1; // TEXT: [[@LINE]]| 161| x =
x = x > 10 ? // TEXT: [[@LINE]]| 161| x =
x - 1: // TEXT: [[@LINE]]| 0| x
x + 1; // TEXT: [[@LINE]]| 161| x
// TEXT: [[@LINE]]| 161|
return 0; // TEXT: [[@LINE]]| 161| return
} // TEXT: [[@LINE]]| 161|}
// after coverage // WHOLE-FILE: [[@LINE]]| |// after
// FILTER-NOT: [[@LINE-1]]| |// after
// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -instr-profile %t.profdata -filename-equivalence %s | FileCheck -check-prefixes=TEXT,WHOLE-FILE %s
// RUN: llvm-cov show %S/Inputs/lineExecutionCounts.covmapping -instr-profile %t.profdata -filename-equivalence -name=main %s | FileCheck -check-prefixes=TEXT,FILTER %s
@ -45,30 +45,30 @@ int main() { // TEXT: 161| [[@LINE]]|int main(
// RUN: FileCheck -check-prefixes=HTML,HTML-WHOLE-FILE -input-file %t.html.dir/coverage/tmp/showLineExecutionCounts.cpp.html %s
// RUN: FileCheck -check-prefixes=HTML,HTML-FILTER -input-file %t.html.dir/functions.html %s
//
// HTML-WHOLE-FILE: <td class='uncovered-line'></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre>// before
// HTML-FILTER-NOT: <td class='uncovered-line'></td><td class='line-number'><a name='L[[@LINE-45]]'><pre>[[@LINE-45]]</pre></a></td><td class='code'><pre>// before
// HTML: <td class='covered-line'><pre>161</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre>int main() {
// HTML: <td class='covered-line'><pre>161</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> int x = 0
// HTML: <td class='covered-line'><pre>161</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre>
// HTML: <td class='uncovered-line'><pre>0</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre><span class='red'> if (x) {
// HTML: <td class='uncovered-line'><pre>0</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre>
// HTML: <td class='covered-line'><pre>161</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre><span class='red'> }</span>
// HTML: <td class='covered-line'><pre>161</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> x = 1;
// HTML: <td class='covered-line'><pre>161</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> }
// HTML: <td class='covered-line'><pre>161</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre>
// HTML: <td class='covered-line'><pre>16.2k</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> for (int i = 0; i &lt; 100; ++i)
// HTML: <td class='covered-line'><pre>16.1k</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> x = 1;
// HTML: <td class='covered-line'><pre>16.1k</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> }
// HTML: <td class='covered-line'><pre>161</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre>
// HTML: <td class='covered-line'><pre>161</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> x = x &lt; 10
// HTML: <td class='covered-line'><pre>161</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> x = x &gt; 10
// HTML: <td class='uncovered-line'><pre>0</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre><span class='red'> x - 1:
// HTML: <td class='covered-line'><pre>161</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> x + 1;
// HTML: <td class='covered-line'><pre>161</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre>
// HTML: <td class='covered-line'><pre>161</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> return 0;
// HTML: <td class='covered-line'><pre>161</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre>}
// HTML-WHOLE-FILE: <td class='uncovered-line'></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre>// after
// HTML-FILTER-NOT: <td class='uncovered-line'></td><td class='line-number'><a name='L[[@LINE-45]]'><pre>[[@LINE-45]]</pre></a></td><td class='code'><pre>// after
// HTML-WHOLE-FILE: <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
// 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
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>161</pre></td><td class='code'><pre>int main() {
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>161</pre></td><td class='code'><pre> int x = 0
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>161</pre></td><td class='code'><pre>
// HTML: <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><span class='red'> if (x) {
// HTML: <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>
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>161</pre></td><td class='code'><pre><span class='red'> }</span>
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>161</pre></td><td class='code'><pre> x = 1;
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>161</pre></td><td class='code'><pre> }
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>161</pre></td><td class='code'><pre>
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>16.2k</pre></td><td class='code'><pre> for (int i = 0; i &lt; 100; ++i)
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>16.1k</pre></td><td class='code'><pre> x = 1;
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>16.1k</pre></td><td class='code'><pre> }
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>161</pre></td><td class='code'><pre>
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>161</pre></td><td class='code'><pre> x = x &lt; 10
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>161</pre></td><td class='code'><pre> x = x &gt; 10
// HTML: <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><span class='red'> x - 1:
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>161</pre></td><td class='code'><pre> x + 1;
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>161</pre></td><td class='code'><pre>
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>161</pre></td><td class='code'><pre> return 0;
// HTML: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='covered-line'><pre>161</pre></td><td class='code'><pre>}
// HTML-WHOLE-FILE: <td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='uncovered-line'></td><td class='code'><pre>// after
// 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>// after
// RUN: llvm-cov export %S/Inputs/lineExecutionCounts.covmapping -instr-profile %t.profdata -name=main 2>/dev/null > %t.export.json
// RUN: FileCheck -input-file %t.export.json %S/Inputs/lineExecutionCounts.json

View File

@ -1,43 +1,43 @@
// 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<typename T> // ALL: | [[@LINE]]|template<typename T>
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]]|}
// before coverage // ALL: [[@LINE]]| |// before
// FILTER-NOT:[[@LINE-1]]| |// before
template<typename T> // ALL: [[@LINE]]| |template<typename T>
int func(T x) { // ALL-NEXT: [[@LINE]]| 2|int func(T x) {
if(x) // ALL-NEXT: [[@LINE]]| 2| if(x)
return 0; // ALL-NEXT: [[@LINE]]| 1| return 0;
else // ALL-NEXT: [[@LINE]]| 2| else
return 1; // ALL-NEXT: [[@LINE]]| 1| return 1;
int j = 1; // ALL-NEXT: [[@LINE]]| 0| int j = 1;
} // ALL-NEXT: [[@LINE]]| 2|}
// 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]]|}
// SHARED-NEXT: [[@LINE-9]]| 1|int func(T x) {
// SHARED-NEXT: [[@LINE-9]]| 1| if(x)
// SHARED-NEXT: [[@LINE-9]]| 1| return 0;
// SHARED-NEXT: [[@LINE-9]]| 1| else
// SHARED-NEXT: [[@LINE-9]]| 0| return 1;
// SHARED-NEXT: [[@LINE-9]]| 0| int j = 1;
// SHARED-NEXT: [[@LINE-9]]| 1|}
// 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]]|}
// ALL-NEXT: [[@LINE-19]]| 1|int func(T x) {
// ALL-NEXT: [[@LINE-19]]| 1| if(x)
// ALL-NEXT: [[@LINE-19]]| 0| return 0;
// ALL-NEXT: [[@LINE-19]]| 1| else
// ALL-NEXT: [[@LINE-19]]| 1| return 1;
// ALL-NEXT: [[@LINE-19]]| 0| int j = 1;
// ALL-NEXT: [[@LINE-19]]| 1|}
int main() { // ALL: 1| [[@LINE]]|int main() {
func<int>(0); // ALL-NEXT: 1| [[@LINE]]| func<int>(0);
func<bool>(true); // ALL-NEXT: 1| [[@LINE]]| func<bool>(true);
return 0; // ALL-NEXT: 1| [[@LINE]]| return 0;
} // ALL-NEXT: 1| [[@LINE]]|}
// after coverage // ALL-NEXT: | [[@LINE]]|// after
// FILTER-NOT: | [[@LINE-1]]|// after
int main() { // ALL: [[@LINE]]| 1|int main() {
func<int>(0); // ALL-NEXT: [[@LINE]]| 1| func<int>(0);
func<bool>(true); // ALL-NEXT: [[@LINE]]| 1| func<bool>(true);
return 0; // ALL-NEXT: [[@LINE]]| 1| return 0;
} // ALL-NEXT: [[@LINE]]| 1|}
// 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
@ -45,41 +45,41 @@ int main() { // ALL: 1| [[@LINE]]|int main() {
// 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: <td class='uncovered-line'></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre>// before
// HTML-FILTER-NOT: <td class='uncovered-line'></td><td class='line-number'><a name='L[[@LINE-45]]'><pre>[[@LINE-45]]</pre></a></td><td class='code'><pre>// before
// HTML-ALL: <td class='uncovered-line'></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre>template&lt;typename T&gt;
// HTML-ALL: <td class='covered-line'><pre>2</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre>int func(T x) {
// HTML-ALL: <td class='covered-line'><pre>2</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> if(x)
// HTML-ALL: <td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> ret
// HTML-ALL: <td class='covered-line'><pre>2</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> else
// HTML-ALL: <td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> ret
// HTML-ALL: <td class='uncovered-line'><pre>0</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre>
// HTML-ALL: <td class='covered-line'><pre>2</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre>}
// 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
// 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
// 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&lt;typename T&gt;
// 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) {
// 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)
// 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
// 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
// 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
// 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>
// 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>}
// HTML-SHARED: <div class='source-name-title'><pre>_Z4funcIbEiT_</pre></div><table>
// HTML-SHARED: <td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='code'><pre>int func(T x) {
// HTML-SHARED: <td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='code'><pre> if(x)
// HTML-SHARED: <td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='code'><pre> ret
// HTML-SHARED: <td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='code'><pre> else
// HTML-SHARED: <td class='uncovered-line'><pre>0</pre></td><td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='code'><pre>
// HTML-SHARED: <td class='uncovered-line'><pre>0</pre></td><td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='code'><pre>
// HTML-SHARED: <td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-53]]'><pre>[[@LINE-53]]</pre></a></td><td class='code'><pre>}
// 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) {
// 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)
// 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
// 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
// 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>
// 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>
// 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>}
// HTML-ALL: <div class='source-name-title'><pre>_Z4funcIiEiT_</pre></div><table>
// HTML-FILTER-NOT: <div class='source-name-title'><pre>_Z4funcIiEiT_</pre></div><table>
// HTML-ALL: <td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-63]]'><pre>[[@LINE-63]]</pre></a></td><td class='code'><pre>int func(T x) {
// HTML-ALL: <td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-63]]'><pre>[[@LINE-63]]</pre></a></td><td class='code'><pre> if(x)
// HTML-ALL: <td class='uncovered-line'><pre>0</pre></td><td class='line-number'><a name='L[[@LINE-63]]'><pre>[[@LINE-63]]</pre></a></td><td class='code'><pre>
// HTML-ALL: <td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-63]]'><pre>[[@LINE-63]]</pre></a></td><td class='code'><pre> else
// HTML-ALL: <td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-63]]'><pre>[[@LINE-63]]</pre></a></td><td class='code'><pre> ret
// HTML-ALL: <td class='uncovered-line'><pre>0</pre></td><td class='line-number'><a name='L[[@LINE-63]]'><pre>[[@LINE-63]]</pre></a></td><td class='code'><pre>
// HTML-ALL: <td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-63]]'><pre>[[@LINE-63]]</pre></a></td><td class='code'><pre>}
// 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) {
// 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)
// 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>
// 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
// 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
// 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>
// 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>}
// HTML-ALL: td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre>int main() {
// HTML-ALL: <td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> func&lt;int&gt;(0);
// HTML-ALL: <td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> func&lt;bool&gt;(true);
// HTML-ALL: <td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre> return 0;
// HTML-ALL: <td class='covered-line'><pre>1</pre></td><td class='line-number'><a name='L[[@LINE-44]]'><pre>[[@LINE-44]]</pre></a></td><td class='code'><pre>}
// 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() {
// 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&lt;int&gt;(0);
// 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&lt;bool&gt;(true);
// 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;
// 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>}
// HTML-ALL: <td class='uncovered-line'></td><td class='line-number'><a name='L[[@LINE-45]]'><pre>[[@LINE-45]]</pre></a></td><td class='code'><pre>// after
// HTML-FILTER-NOT: <td class='uncovered-line'></td><td class='line-number'><a name='L[[@LINE-46]]'><pre>[[@LINE-46]]</pre></a></td><td class='code'><pre>// after
// 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
// 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

View File

@ -1,6 +1,6 @@
// The coverage reader should be able to handle universal binaries
// CHECK: 100| [[@LINE+1]]|int main
// CHECK: [[@LINE+1]]| 100|int main
int main(int argc, const char *argv[]) {}
// RUN: llvm-profdata merge %S/Inputs/universal-binary.proftext -o %t.profdata

View File

@ -182,10 +182,10 @@ void SourceCoverageView::print(raw_ostream &OS, bool WholeFile,
LineCount.addRegionStartCount(S->Count);
renderLinePrefix(OS, ViewDepth);
if (getOptions().ShowLineStats)
renderLineCoverageColumn(OS, LineCount);
if (getOptions().ShowLineNumbers)
renderLineNumberColumn(OS, LI.line_number());
if (getOptions().ShowLineStats)
renderLineCoverageColumn(OS, LineCount);
// If there are expansion subviews, we want to highlight the first one.
unsigned ExpansionColumn = 0;