Index: test/tools/llvm-cov/Inputs/noZeroExecutionLine.proftext =================================================================== --- /dev/null +++ test/tools/llvm-cov/Inputs/noZeroExecutionLine.proftext @@ -0,0 +1,9 @@ +main +# Func Hash: +4 +# Num Counters: +2 +# Counter Values: +1 +10 + Index: test/tools/llvm-cov/Inputs/showProjectSummary.proftext =================================================================== --- /dev/null +++ test/tools/llvm-cov/Inputs/showProjectSummary.proftext @@ -0,0 +1,10 @@ +main +# Func Hash: +266 +# Num Counters: +3 +# Counter Values: +1 +20 +0 + 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/noZeroExecutionLine.cpp =================================================================== --- /dev/null +++ test/tools/llvm-cov/noZeroExecutionLine.cpp @@ -0,0 +1,16 @@ +// RUN: llvm-profdata merge -o %t.profdata %S/Inputs/noZeroExecutionLine.proftext +// RUN: llvm-cov show %S/Inputs/noZeroExecutionLine.covmapping -instr-profile %t.profdata -filename-equivalence -format html -output-dir %t.dir %s +// RUN: FileCheck -check-prefix=CHECK -check-prefix=WHOLE-FILE -input-file %t.dir/coverage/tmp/noZeroExecutionLine.cpp.html %s + +int main(int argc, char ** argv) { + int x=0; + for (int i = 0; i < 10; ++i) + x *= 2; + return x; +} + +// CHECK: Goto first zero count +// CHECK-NOT: