mirror of
https://github.com/ziglang/zig.git
synced 2024-12-04 02:48:50 +00:00
24 lines
418 B
Zig
24 lines
418 B
Zig
const assert = @import("std").debug.assert;
|
|
|
|
fn foo(id: u64) -> %i32 {
|
|
return switch (id) {
|
|
1 => getErrInt(),
|
|
2 => {
|
|
const size = %return getErrInt();
|
|
return %return getErrInt();
|
|
},
|
|
else => error.ItBroke,
|
|
}
|
|
}
|
|
|
|
fn getErrInt() -> %i32 { 0 }
|
|
|
|
error ItBroke;
|
|
|
|
fn irBlockDeps() {
|
|
@setFnTest(this);
|
|
|
|
assert(%%foo(1) == 0);
|
|
assert(%%foo(2) == 0);
|
|
}
|