Index: test/tools/llvm-cov/binary-formats.c
===================================================================
--- test/tools/llvm-cov/binary-formats.c
+++ test/tools/llvm-cov/binary-formats.c
@@ -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
Index: test/tools/llvm-cov/combine_expansions.cpp
===================================================================
--- test/tools/llvm-cov/combine_expansions.cpp
+++ test/tools/llvm-cov/combine_expansions.cpp
@@ -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|}
Index: test/tools/llvm-cov/prefer_used_to_unused.h
===================================================================
--- test/tools/llvm-cov/prefer_used_to_unused.h
+++ test/tools/llvm-cov/prefer_used_to_unused.h
@@ -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|}
Index: test/tools/llvm-cov/showLineExecutionCounts.cpp
===================================================================
--- test/tools/llvm-cov/showLineExecutionCounts.cpp
+++ test/tools/llvm-cov/showLineExecutionCounts.cpp
@@ -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 @@
// 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:
| [[@LINE-44]] | // before
-// HTML-FILTER-NOT: | [[@LINE-45]] | // before
-// HTML: 161 | [[@LINE-44]] | int main() {
-// HTML: 161 | [[@LINE-44]] | int x = 0
-// HTML: 161 | [[@LINE-44]] |
-// HTML: 0 | [[@LINE-44]] | if (x) {
-// HTML: 0 | [[@LINE-44]] |
-// HTML: 161 | [[@LINE-44]] | }
-// HTML: 161 | [[@LINE-44]] | x = 1;
-// HTML: 161 | [[@LINE-44]] | }
-// HTML: 161 | [[@LINE-44]] |
-// HTML: 16.2k | [[@LINE-44]] | for (int i = 0; i < 100; ++i)
-// HTML: 16.1k | [[@LINE-44]] | x = 1;
-// HTML: 16.1k | [[@LINE-44]] | }
-// HTML: 161 | [[@LINE-44]] |
-// HTML: 161 | [[@LINE-44]] | x = x < 10
-// HTML: 161 | [[@LINE-44]] | x = x > 10
-// HTML: 0 | [[@LINE-44]] | x - 1:
-// HTML: 161 | [[@LINE-44]] | x + 1;
-// HTML: 161 | [[@LINE-44]] |
-// HTML: 161 | [[@LINE-44]] | return 0;
-// HTML: 161 | [[@LINE-44]] | }
-// HTML-WHOLE-FILE: | [[@LINE-44]] | // after
-// HTML-FILTER-NOT: | [[@LINE-45]] | // after
+// HTML-WHOLE-FILE: [[@LINE-44]] | | // before
+// HTML-FILTER-NOT: [[@LINE-45]] | | // before
+// HTML: [[@LINE-44]] | 161 | int main() {
+// HTML: [[@LINE-44]] | 161 | int x = 0
+// HTML: [[@LINE-44]] | 161 |
+// HTML: [[@LINE-44]] | 0 | if (x) {
+// HTML: [[@LINE-44]] | 0 |
+// HTML: [[@LINE-44]] | 161 | }
+// HTML: [[@LINE-44]] | 161 | x = 1;
+// HTML: [[@LINE-44]] | 161 | }
+// HTML: [[@LINE-44]] | 161 |
+// HTML: [[@LINE-44]] | 16.2k | for (int i = 0; i < 100; ++i)
+// HTML: [[@LINE-44]] | 16.1k | x = 1;
+// HTML: [[@LINE-44]] | 16.1k | }
+// HTML: [[@LINE-44]] | 161 |
+// HTML: [[@LINE-44]] | 161 | x = x < 10
+// HTML: [[@LINE-44]] | 161 | x = x > 10
+// HTML: [[@LINE-44]] | 0 | x - 1:
+// HTML: [[@LINE-44]] | 161 | x + 1;
+// HTML: [[@LINE-44]] | 161 |
+// HTML: [[@LINE-44]] | 161 | return 0;
+// HTML: [[@LINE-44]] | 161 | }
+// HTML-WHOLE-FILE: [[@LINE-44]] | | // after
+// HTML-FILTER-NOT: [[@LINE-45]] | | // 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
Index: test/tools/llvm-cov/showTemplateInstantiations.cpp
===================================================================
--- test/tools/llvm-cov/showTemplateInstantiations.cpp
+++ test/tools/llvm-cov/showTemplateInstantiations.cpp
@@ -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 // ALL: | [[@LINE]]|template
-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 // ALL: [[@LINE]]| |template
+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(0); // ALL-NEXT: 1| [[@LINE]]| func(0);
- func(true); // ALL-NEXT: 1| [[@LINE]]| func(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(0); // ALL-NEXT: [[@LINE]]| 1| func(0);
+ func(true); // ALL-NEXT: [[@LINE]]| 1| func(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 @@
// 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: | [[@LINE-44]] | // before
-// HTML-FILTER-NOT: | [[@LINE-45]] | // before
-// HTML-ALL: | [[@LINE-44]] | template<typename T>
-// HTML-ALL: 2 | [[@LINE-44]] | int func(T x) {
-// HTML-ALL: 2 | [[@LINE-44]] | if(x)
-// HTML-ALL: 1 | [[@LINE-44]] | ret
-// HTML-ALL: 2 | [[@LINE-44]] | else
-// HTML-ALL: 1 | [[@LINE-44]] | ret
-// HTML-ALL: 0 | [[@LINE-44]] |
-// HTML-ALL: 2 | [[@LINE-44]] | }
+// HTML-ALL: [[@LINE-44]] | | // before
+// HTML-FILTER-NOT: [[@LINE-45]] | | // before
+// HTML-ALL: [[@LINE-44]] | | template<typename T>
+// HTML-ALL: [[@LINE-44]] | 2 | int func(T x) {
+// HTML-ALL: [[@LINE-44]] | 2 | if(x)
+// HTML-ALL: [[@LINE-44]] | 1 | ret
+// HTML-ALL: [[@LINE-44]] | 2 | else
+// HTML-ALL: [[@LINE-44]] | 1 | ret
+// HTML-ALL: [[@LINE-44]] | 0 |
+// HTML-ALL: [[@LINE-44]] | 2 | }
// HTML-SHARED:
-// HTML-SHARED: 1 | [[@LINE-53]] | int func(T x) {
-// HTML-SHARED: 1 | [[@LINE-53]] | if(x)
-// HTML-SHARED: 1 | [[@LINE-53]] | ret
-// HTML-SHARED: 1 | [[@LINE-53]] | else
-// HTML-SHARED: 0 | [[@LINE-53]] |
-// HTML-SHARED: 0 | [[@LINE-53]] |
-// HTML-SHARED: 1 | [[@LINE-53]] | }
+// HTML-SHARED: [[@LINE-53]] | 1 | int func(T x) {
+// HTML-SHARED: [[@LINE-53]] | 1 | if(x)
+// HTML-SHARED: [[@LINE-53]] | 1 | ret
+// HTML-SHARED: [[@LINE-53]] | 1 | else
+// HTML-SHARED: [[@LINE-53]] | 0 |
+// HTML-SHARED: [[@LINE-53]] | 0 |
+// HTML-SHARED: [[@LINE-53]] | 1 | }
// HTML-ALL:
// HTML-FILTER-NOT:
-// HTML-ALL: 1 | [[@LINE-63]] | int func(T x) {
-// HTML-ALL: 1 | [[@LINE-63]] | if(x)
-// HTML-ALL: 0 | [[@LINE-63]] |
-// HTML-ALL: 1 | [[@LINE-63]] | else
-// HTML-ALL: 1 | [[@LINE-63]] | ret
-// HTML-ALL: 0 | [[@LINE-63]] |
-// HTML-ALL: 1 | [[@LINE-63]] | }
+// HTML-ALL: [[@LINE-63]] | 1 | int func(T x) {
+// HTML-ALL: [[@LINE-63]] | 1 | if(x)
+// HTML-ALL: [[@LINE-63]] | 0 |
+// HTML-ALL: [[@LINE-63]] | 1 | else
+// HTML-ALL: [[@LINE-63]] | 1 | ret
+// HTML-ALL: [[@LINE-63]] | 0 |
+// HTML-ALL: [[@LINE-63]] | 1 | }
-// HTML-ALL: td class='covered-line'>1 | [[@LINE-44]] | int main() {
-// HTML-ALL: 1 | [[@LINE-44]] | func<int>(0);
-// HTML-ALL: 1 | [[@LINE-44]] | func<bool>(true);
-// HTML-ALL: 1 | [[@LINE-44]] | return 0;
-// HTML-ALL: 1 | [[@LINE-44]] | }
+// HTML-ALL: [[@LINE-44]] | 1 | int main() {
+// HTML-ALL: [[@LINE-44]] | 1 | func<int>(0);
+// HTML-ALL: [[@LINE-44]] | 1 | func<bool>(true);
+// HTML-ALL: [[@LINE-44]] | 1 | return 0;
+// HTML-ALL: [[@LINE-44]] | 1 | }
-// HTML-ALL: | [[@LINE-45]] | // after
-// HTML-FILTER-NOT: | [[@LINE-46]] | // after
+// HTML-ALL: [[@LINE-45]] | | // after
+// HTML-FILTER-NOT: [[@LINE-46]] | | // after
Index: test/tools/llvm-cov/universal-binary.c
===================================================================
--- test/tools/llvm-cov/universal-binary.c
+++ test/tools/llvm-cov/universal-binary.c
@@ -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
Index: tools/llvm-cov/SourceCoverageView.cpp
===================================================================
--- tools/llvm-cov/SourceCoverageView.cpp
+++ tools/llvm-cov/SourceCoverageView.cpp
@@ -182,10 +182,10 @@
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;
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |