summaryrefslogtreecommitdiffstats
path: root/clang/test/CoverageMapping/label.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2017-11-09 02:33:39 +0000
committerVedant Kumar <vsk@apple.com>2017-11-09 02:33:39 +0000
commit8046d22a36eeed2bf38d17006daf486acf520f7e (patch)
tree7f01bc7f5418254926c289b71a661a0ed324a8d9 /clang/test/CoverageMapping/label.cpp
parent2e8c87590546477736d6744edf8f5cf48bf1ef41 (diff)
downloadbcm5719-llvm-8046d22a36eeed2bf38d17006daf486acf520f7e.tar.gz
bcm5719-llvm-8046d22a36eeed2bf38d17006daf486acf520f7e.zip
[Coverage] Complete top-level deferred regions before labels
The area immediately after a terminated region in the function top-level should have the same count as the label it precedes. This solves another problem with wrapped segments. Consider: 1| a: 2| return 0; 3| b: 4| return 1; Without a gap area starting after the first return, the wrapped segment from line 2 would make it look like line 3 is executed, when it's not. rdar://35373009 llvm-svn: 317759
Diffstat (limited to 'clang/test/CoverageMapping/label.cpp')
-rw-r--r--clang/test/CoverageMapping/label.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/test/CoverageMapping/label.cpp b/clang/test/CoverageMapping/label.cpp
index 6e8a078fe6c..a0bd4fd352c 100644
--- a/clang/test/CoverageMapping/label.cpp
+++ b/clang/test/CoverageMapping/label.cpp
@@ -28,8 +28,8 @@ void test1(int x) { // CHECK-NEXT: File 0, [[@LINE]]:19 -> {{[0-9]+}}:2
if(x == 0) // CHECK-NEXT: File 0, [[@LINE]]:6 -> [[@LINE]]:12 = #0
goto a; // CHECK: File 0, [[@LINE]]:5 -> [[@LINE]]:11 = #1
// CHECK-NEXT: File 0, [[@LINE-1]]:11 -> [[@LINE+1]]:3 = (#0 - #1)
- goto b; // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+5]]:2 = (#0 - #1)
- // CHECK-NEXT: File 0, [[@LINE-1]]:3 -> [[@LINE+4]]:2 = #3
+ goto b; // CHECK: Gap,File 0, [[@LINE]]:3 -> [[@LINE+5]]:2 = #3
+ // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:9 -> [[@LINE+1]]:1 = #2
a: // CHECK-NEXT: File 0, [[@LINE]]:1 -> [[@LINE+3]]:2 = #2
b: // CHECK-NEXT: File 0, [[@LINE]]:1 -> [[@LINE+2]]:2 = #3
x = x + 1;
@@ -58,7 +58,7 @@ int main() { // CHECK-NEXT: File 0, [[@LINE]]:12 -> {{[0-9]+}}:2
goto e; // CHECK: File 0, [[@LINE]]:7 -> [[@LINE]]:13 = #3
// CHECK-NEXT: File 0, [[@LINE-1]]:13 -> [[@LINE+1]]:5 = (#2 - #3)
goto c; // CHECK-NEXT: File 0, [[@LINE]]:5 -> [[@LINE+8]]:4 = (#2 - #3)
-
+ // CHECK-NEXT: Gap,File 0, [[@LINE-1]]:11 -> [[@LINE+1]]:3 = #4
b: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+6]]:4 = #4
j = 2;
c: // CHECK-NEXT: File 0, [[@LINE]]:3 -> [[@LINE+4]]:4 = #5
OpenPOWER on IntegriCloud