diff options
author | Vedant Kumar <vsk@apple.com> | 2017-11-09 02:33:38 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2017-11-09 02:33:38 +0000 |
commit | 2e8c87590546477736d6744edf8f5cf48bf1ef41 (patch) | |
tree | db6af1baad05772a59d39d29676d98a8ee272dc5 /clang/test/CoverageMapping/break.c | |
parent | c6721f580df11bb0bd00217a45430d163770a278 (diff) | |
download | bcm5719-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/break.c')
-rw-r--r-- | clang/test/CoverageMapping/break.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/CoverageMapping/break.c b/clang/test/CoverageMapping/break.c index ee41271b53f..b15f60b6e08 100644 --- a/clang/test/CoverageMapping/break.c +++ b/clang/test/CoverageMapping/break.c @@ -15,7 +15,7 @@ int main() { // CHECK: File 0, [[@LINE]]:12 -> {{[0-9]+}}:2 = #0 } // CHECK-NEXT: File 0, [[@LINE+1]]:9 -> [[@LINE+1]]:18 = ((#0 + #3) - #4) while(cnt < 100) { // CHECK-NEXT: File 0, [[@LINE]]:20 -> [[@LINE+7]]:4 = #3 // CHECK-NEXT: File 0, [[@LINE+1]]:8 -> [[@LINE+1]]:16 = #3 - if(cnt == 0) { // CHECK-NEXT: File 0, [[@LINE]]:18 -> [[@LINE+3]]:6 = #4 + if(cnt == 0) { // CHECK: File 0, [[@LINE]]:18 -> [[@LINE+3]]:6 = #4 break; ++cnt; // CHECK-NEXT: File 0, [[@LINE]]:7 -> [[@LINE+1]]:6 = 0 } @@ -23,8 +23,8 @@ int main() { // CHECK: File 0, [[@LINE]]:12 -> {{[0-9]+}}:2 = #0 } // CHECK-NEXT: File 0, [[@LINE+1]]:9 -> [[@LINE+1]]:18 = (#0 + #6) while(cnt < 100) { // CHECK-NEXT: File 0, [[@LINE]]:20 -> [[@LINE+8]]:4 = #5 // CHECK-NEXT: File 0, [[@LINE+1]]:8 -> [[@LINE+1]]:16 = #5 - if(cnt == 0) { // CHECK-NEXT: File 0, [[@LINE]]:18 -> [[@LINE+2]]:6 = #6 - ++cnt; + if(cnt == 0) { // CHECK: File 0, [[@LINE]]:18 -> [[@LINE+2]]:6 = #6 + ++cnt; // CHECK-NEXT: Gap,File 0, [[@LINE+1]]:6 -> [[@LINE+1]]:12 = (#5 - #6) } else { // CHECK-NEXT: File 0, [[@LINE]]:12 -> [[@LINE+2]]:6 = (#5 - #6) break; } |