diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2025-07-26 06:23:31 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2025-07-26 06:24:03 -0400 |
| commit | 68cfa736dfd38cc151af1f9e1b0edb3041bc237c (patch) | |
| tree | 8ad7d54f9e83d9139eec47e52a09a9412a7b9718 /test/behavior | |
| parent | fc4b7c968afa6fa0780a011f3c8cfeaea38b7b98 (diff) | |
| download | zig-68cfa736dfd38cc151af1f9e1b0edb3041bc237c.tar.gz zig-68cfa736dfd38cc151af1f9e1b0edb3041bc237c.zip | |
x86_64: fix switch on mod result
Closes #24541
Diffstat (limited to 'test/behavior')
| -rw-r--r-- | test/behavior/switch.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/behavior/switch.zig b/test/behavior/switch.zig index 813530b361..764080b937 100644 --- a/test/behavior/switch.zig +++ b/test/behavior/switch.zig @@ -1072,3 +1072,13 @@ test "switch on a signed value smaller than the smallest prong value" { else => {}, } } + +test "switch on 8-bit mod result" { + var x: u8 = undefined; + x = 16; + switch (x % 4) { + 0 => {}, + 1, 2, 3 => return error.TestFailed, + else => unreachable, + } +} |
