| ... | @@ -0,0 +1,23 @@ |
| 1 | #target=x86_64-linux-selfhosted |
| 2 | #target=x86_64-linux-cbe |
| 3 | #target=x86_64-windows-cbe |
| 4 | #update=initial version |
| 5 | #file=main.zig |
| 6 | pub fn main() !void { |
| 7 | try foo(0x1300); |
| 8 | } |
| 9 | fn foo(x: u16) !void { |
| 10 | try std.io.getStdOut().writer().print("0x{x}\n", .{x << 4}); |
| 11 | } |
| 12 | const std = @import("std"); |
| 13 | #expect_stdout="0x3000\n" |
| 14 | #update=change to right shift |
| 15 | #file=main.zig |
| 16 | pub fn main() !void { |
| 17 | try foo(0x1300); |
| 18 | } |
| 19 | fn foo(x: u16) !void { |
| 20 | try std.io.getStdOut().writer().print("0x{x}\n", .{x >> 4}); |
| 21 | } |
| 22 | const std = @import("std"); |
| 23 | #expect_stdout="0x130\n" |