summaryrefslogtreecommitdiffstats
path: root/clang/test/CoverageMapping/switch.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-11-09 02:33:38 +0000
committerVedant Kumar <vsk@apple.com>2017-11-09 02:33:38 +0000
commit2e8c87590546477736d6744edf8f5cf48bf1ef41 (patch)
treedb6af1baad05772a59d39d29676d98a8ee272dc5 /clang/test/CoverageMapping/switch.cpp
parentc6721f580df11bb0bd00217a45430d163770a278 (diff)
downloadbcm5719-llvm-2e8c87590546477736d6744edf8f5cf48bf1ef41.tar.gz
bcm5719-llvm-2e8c87590546477736d6744edf8f5cf48bf1ef41.zip
[Coverage] Emit a gap area after if conditions
The area immediately after the closing right-paren of an if condition should have a count equal to the 'then' block's count. Use a gap region to set this count, so that region highlighting for the 'then' block remains precise. This solves a problem we have with wrapped segments. Consider: 1| if (false) 2| foo(); Without a gap area starting after the condition, the wrapped segment from line 1 would make it look like line 2 is executed, when it's not. rdar://35373009 llvm-svn: 317758
Diffstat (limited to 'clang/test/CoverageMapping/switch.cpp')
-rw-r--r--clang/test/CoverageMapping/switch.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/CoverageMapping/switch.cpp b/clang/test/CoverageMapping/switch.cpp
index d347e663d10..30c64922201 100644
--- a/clang/test/CoverageMapping/switch.cpp
+++ b/clang/test/CoverageMapping/switch.cpp
@@ -38,7 +38,7 @@ void bar(int i) { // CHECK-NEXT: File 0, [[@LINE]]:17 -> [[@LINE+20]]:2 = #0
// CHECK: baz
void baz() { // CHECK-NEXT: File 0, [[@LINE]]:12 -> [[@LINE+5]]:2 = #0
- switch (int i = true ? nop() // CHECK-NEXT: [[@LINE]]:26 -> [[@LINE]]:31 = #2
+ switch (int i = true ? nop() // CHECK: [[@LINE]]:26 -> [[@LINE]]:31 = #2
: nop(); // CHECK-NEXT: [[@LINE]]:26 -> [[@LINE]]:31 = (#0 - #2)
i) {}
nop(); // CHECK-NEXT: [[@LINE]]:3 -> [[@LINE+1]]:2 = #1
OpenPOWER on IntegriCloud