diff options
| author | amp-59 <114923809+amp-59@users.noreply.github.com> | 2023-12-26 23:14:48 +0000 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-01-04 00:10:41 -0700 |
| commit | 10016e0368c382363e168e45fac2cca4bc64e38f (patch) | |
| tree | ca3e36c7c8e26b5c9353a40602d07293933a3a9c /test | |
| parent | ecd520f6619c08cac17f8f662facc90595444ac5 (diff) | |
| download | zig-10016e0368c382363e168e45fac2cca4bc64e38f.tar.gz zig-10016e0368c382363e168e45fac2cca4bc64e38f.zip | |
Sema: fix crash compiling `@shlExact`
Updated `zirShl`, to compute `shl_exact` with `comptime_int` LHS operand
like `shl`, and added test case for `@shlExact` with `comptime_int` LHS
operand.
Diffstat (limited to 'test')
| -rw-r--r-- | test/cases/shl_exact_comptime_int_lhs.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/cases/shl_exact_comptime_int_lhs.zig b/test/cases/shl_exact_comptime_int_lhs.zig new file mode 100644 index 0000000000..60860f5113 --- /dev/null +++ b/test/cases/shl_exact_comptime_int_lhs.zig @@ -0,0 +1,6 @@ +export fn entry() void { + if (@shlExact(1, 1) != 2) @compileError("should be 2"); +} + +// compile +// output_mode=Obj |
