aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/switch_loop.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-07-14 10:02:37 -0700
committerAndrew Kelley <andrew@ziglang.org>2025-07-14 10:02:37 -0700
commitb993728f10c213b679def931c2f59c8e64b14660 (patch)
tree385130550ebb3290136828095d136804aee9b24f /test/behavior/switch_loop.zig
parent29ac68b2537b9a9c67f92cc2a5dd4c35bf1c2b31 (diff)
downloadzig-b993728f10c213b679def931c2f59c8e64b14660.tar.gz
zig-b993728f10c213b679def931c2f59c8e64b14660.zip
make it a behavior test instead
It's important to check for correct runtime behavior, rather than only checking that the compiler does not crash.
Diffstat (limited to 'test/behavior/switch_loop.zig')
-rw-r--r--test/behavior/switch_loop.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/behavior/switch_loop.zig b/test/behavior/switch_loop.zig
index 687ed466d9..98605692be 100644
--- a/test/behavior/switch_loop.zig
+++ b/test/behavior/switch_loop.zig
@@ -216,3 +216,13 @@ test "switch loop with pointer capture" {
try S.doTheTest();
try comptime S.doTheTest();
}
+
+test "unanalyzed continue with operand" {
+ if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
+
+ @setRuntimeSafety(false);
+ label: switch (false) {
+ false => if (false) continue :label true,
+ true => {},
+ }
+}