aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-01-04 04:19:26 -0800
committerGitHub <noreply@github.com>2024-01-04 04:19:26 -0800
commit9a1608509300fcdf118d82063bbf1481a10ca551 (patch)
tree0c3b2cdc5f9462c26c9e41edcabc793ce66970e2 /test
parent537e2808e04fc34bb2015433895a57c15118eb28 (diff)
parent52ebba6bdf5662353ce11a701a3361cc0616c01c (diff)
downloadzig-9a1608509300fcdf118d82063bbf1481a10ca551.tar.gz
zig-9a1608509300fcdf118d82063bbf1481a10ca551.zip
Merge pull request #18376 from amp-59/shl_exact_comptime_int_to_shl
Sema: Updated `zirShl` to compute `shl_exact` with `comptime_int` LHS using `shl`
Diffstat (limited to 'test')
-rw-r--r--test/behavior/math.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/behavior/math.zig b/test/behavior/math.zig
index 3d3c282854..4f9f7a673d 100644
--- a/test/behavior/math.zig
+++ b/test/behavior/math.zig
@@ -1314,6 +1314,8 @@ test "exact shift left" {
try testShlExact(0b00110101);
try comptime testShlExact(0b00110101);
+
+ if (@shlExact(1, 1) != 2) @compileError("should be 2");
}
fn testShlExact(x: u8) !void {
const shifted = @shlExact(x, 2);