summaryrefslogtreecommitdiffstats
path: root/clang/test/CoverageMapping/if.c
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2015-02-19 03:10:30 +0000
committerJustin Bogner <mail@justinbogner.com>2015-02-19 03:10:30 +0000
commit91f2e3c9c2650795d95c80a7f922054ca74c1ac5 (patch)
tree4b102469f03aa1e8ac71b35eb4f813b61cd152c9 /clang/test/CoverageMapping/if.c
parent62d8aa5caf0a2a7b699b2dc5d98b1fdcd8b6053d (diff)
downloadbcm5719-llvm-91f2e3c9c2650795d95c80a7f922054ca74c1ac5.tar.gz
bcm5719-llvm-91f2e3c9c2650795d95c80a7f922054ca74c1ac5.zip
InstrProf: Always emit a coverage region for the condition of an if
When tools like llvm-cov show regions, it's much easier to understand what's happening if the condition of an if shows a counter as well as the body. llvm-svn: 229813
Diffstat (limited to 'clang/test/CoverageMapping/if.c')
-rw-r--r--clang/test/CoverageMapping/if.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/test/CoverageMapping/if.c b/clang/test/CoverageMapping/if.c
index bfc4cc4bdd0..73b23087167 100644
--- a/clang/test/CoverageMapping/if.c
+++ b/clang/test/CoverageMapping/if.c
@@ -1,13 +1,17 @@
// RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name if.c %s | FileCheck %s
-int main() { // CHECK: File 0, [[@LINE]]:12 -> [[@LINE+21]]:2 = #0
+int main() { // CHECK: File 0, [[@LINE]]:12 -> {{[0-9]+}}:2 = #0
int i = 0;
+ // CHECK-NEXT: File 0, [[@LINE+1]]:6 -> [[@LINE+1]]:12 = #0
if(i == 0) i = 1; // CHECK-NEXT: File 0, [[@LINE]]:14 -> [[@LINE]]:19 = #1
+ // CHECK-NEXT: File 0, [[@LINE+1]]:6 -> [[@LINE+1]]:12 = #0
if(i == 1)
i = 2; // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE]]:10 = #2
+ // CHECK-NEXT: File 0, [[@LINE+1]]:6 -> [[@LINE+1]]:12 = #0
if(i == 0) { i = 1; // CHECK-NEXT: File 0, [[@LINE]]:14 -> [[@LINE+2]]:4 = #3
i = 2;
}
+ // CHECK-NEXT: File 0, [[@LINE+1]]:6 -> [[@LINE+1]]:12 = #0
if(i != 0) { // CHECK-NEXT: File 0, [[@LINE]]:14 -> [[@LINE+2]]:4 = #4
i = 1;
} else { // CHECK-NEXT: File 0, [[@LINE]]:10 -> [[@LINE+2]]:4 = (#0 - #4)
OpenPOWER on IntegriCloud