aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/switch.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-06-07 13:08:22 -0400
committerGitHub <noreply@github.com>2025-06-07 13:08:22 -0400
commit8b875b17ade95c4e0098c7c3b20134f03745aac3 (patch)
tree02ee642b33451b453994f484a2204ddca42e4857 /test/behavior/switch.zig
parent173bc4274446a14aca2eea128b70b35b0ba18ebe (diff)
parent5a52da1b7a8c467087da8f3a20ab902ec8c1e25d (diff)
downloadzig-8b875b17ade95c4e0098c7c3b20134f03745aac3.tar.gz
zig-8b875b17ade95c4e0098c7c3b20134f03745aac3.zip
Merge pull request #24072 from jacobly0/x86_64-default
Compilation: enable the x86_64 backend by default for debug builds
Diffstat (limited to 'test/behavior/switch.zig')
-rw-r--r--test/behavior/switch.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/behavior/switch.zig b/test/behavior/switch.zig
index b518766d97..4ab6362a49 100644
--- a/test/behavior/switch.zig
+++ b/test/behavior/switch.zig
@@ -1056,3 +1056,12 @@ test "unlabeled break ignores switch" {
};
try expect(result == 123);
}
+
+test "switch on a signed value smaller than the smallest prong value" {
+ var v: i32 = undefined;
+ v = -1;
+ switch (v) {
+ inline 0...10 => return error.TestFailed,
+ else => {},
+ }
+}