Skip to content

Commit

Permalink
test: add new incremental case
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mlugg committed Nov 11, 2024
1 parent ca12e4f commit 6e56bc1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/incremental/change_shift_op
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 6e56bc1

Please sign in to comment.