zig/test/cases/ir_block_deps.zig
Andrew Kelley a35b366eb6 [breaking] delete ptr deref prefix op
start using zig-fmt-pointer-reform branch build of zig fmt
to fix code to use the new syntax

all of test/cases/* are processed, but there are more left
to be done - all the std lib used by the behavior tests
2018-04-30 20:35:54 -04:00

22 lines
423 B
Zig

const assert = @import("std").debug.assert;
fn foo(id: u64) !i32 {
return switch (id) {
1 => getErrInt(),
2 => {
const size = try getErrInt();
return try getErrInt();
},
else => error.ItBroke,
};
}
fn getErrInt() error!i32 {
return 0;
}
test "ir block deps" {
assert((foo(1) catch unreachable) == 0);
assert((foo(2) catch unreachable) == 0);
}