From 6e56bc1096eb99a065bc7222bf3264142251da6d Mon Sep 17 00:00:00 2001 From: mlugg Date: Mon, 11 Nov 2024 12:20:30 +0000 Subject: [PATCH] test: add new incremental case This is similar to the old `llvm/shift_right_plus_left` case, which was disabled by 1b1c78c. The case is not enabled on the LLVM backend, since incremental compilation support for this backend is a work in progress and is tracked by #21165. It passes on the x86_64-linux target with the self-hosted backend. Resolves: #12288 --- test/incremental/change_shift_op | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/incremental/change_shift_op diff --git a/test/incremental/change_shift_op b/test/incremental/change_shift_op new file mode 100644 index 000000000000..bd88a70def9e --- /dev/null +++ b/test/incremental/change_shift_op @@ -0,0 +1,23 @@ +#target=x86_64-linux-selfhosted +#target=x86_64-linux-cbe +#target=x86_64-windows-cbe +#update=initial version +#file=main.zig +pub fn main() !void { + try foo(0x1300); +} +fn foo(x: u16) !void { + try std.io.getStdOut().writer().print("0x{x}\n", .{x << 4}); +} +const std = @import("std"); +#expect_stdout="0x3000\n" +#update=change to right shift +#file=main.zig +pub fn main() !void { + try foo(0x1300); +} +fn foo(x: u16) !void { + try std.io.getStdOut().writer().print("0x{x}\n", .{x >> 4}); +} +const std = @import("std"); +#expect_stdout="0x130\n"