x86_64: fix switch on mod result

Closes #24541
This commit is contained in:
Jacob Young
2025-07-26 06:23:31 -04:00
parent fc4b7c968a
commit 68cfa736df
2 changed files with 18 additions and 9 deletions

View File

@@ -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,
}
}