aboutsummaryrefslogtreecommitdiff
path: root/clang/test
diff options
context:
space:
mode:
authorOliver Hunt <oliver@apple.com>2025-08-14 01:52:18 -0700
committerOliver Hunt <oliver@apple.com>2025-08-14 01:52:18 -0700
commit020147d9eaa0696b6d8d9ebbf4fa700d31c93959 (patch)
tree83576620e386cd18db35440c67386ea64ca6fde4 /clang/test
parente2b0c23af1741f2d63634f76ac08bf02eea88a08 (diff)
downloadllvm-users/ojhunt/while-loop-scope.zip
llvm-users/ojhunt/while-loop-scope.tar.gz
llvm-users/ojhunt/while-loop-scope.tar.bz2
Actually commit the codegen fixes this timeusers/ojhunt/while-loop-scope
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CoverageMapping/break.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/clang/test/CoverageMapping/break.c b/clang/test/CoverageMapping/break.c
index 09d0bd4..86aa2a0 100644
--- a/clang/test/CoverageMapping/break.c
+++ b/clang/test/CoverageMapping/break.c
@@ -31,3 +31,27 @@ int main(void) { // CHECK: File 0, [[@LINE]]:16 -> {{[0-9]+}}:2 = #0
++cnt;
}
}
+
+// CHECK-LABEL: break_continue_in_increment:
+/*
+ 52:41 -> 57:2 = #0
+ 53:10 -> 53:11 = ((#0 + #1) + #2)
+ Branch,File 0, 53:10 -> 53:11 = #1, 0
+
+ 53:13 -> 56:4 = #1
+
+
+
+
+*/
+
+ // CHECK: [[@LINE+6]]:20 -> [[@LINE+6]]:21 = #2
+ // CHECK: [[@LINE+5]]:23 -> [[@LINE+5]]:28 = #3
+ // CHECK: [[@LINE+4]]:35 -> [[@LINE+4]]:43 = (#2 - #3)
+ // CHECK: [[@LINE+4]]:7 -> [[@LINE+4]]:8 = #2
+void break_continue_in_increment(int x) {
+ while (1) {
+ for (;; ({ if (x) break; else continue; }))
+ ;
+ }
+}