zig/test/behavior/ir_block_deps.zig
David Rubin 05de6c279b
riscv: std.fmt.format running
- implements `airSlice`, `airBitAnd`, `airBitOr`, `airShr`.

- got a basic design going for the `airErrorName` but for some reason it simply returns
empty bytes. will investigate further.

- only generating `.got.zig` entries when not compiling an object or shared library

- reduced the total amount of ops a mnemonic can have to 3, simplifying the logic
2024-06-13 02:20:47 -07:00

27 lines
729 B
Zig

const builtin = @import("builtin");
const expect = @import("std").testing.expect;
fn foo(id: u64) !i32 {
return switch (id) {
1 => getErrInt(),
2 => {
const size = try getErrInt();
_ = size;
return try getErrInt();
},
else => error.ItBroke,
};
}
fn getErrInt() anyerror!i32 {
return 0;
}
test "ir block deps" {
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
try expect((foo(1) catch unreachable) == 0);
try expect((foo(2) catch unreachable) == 0);
}