zig/test/incremental/llvm/blocks.zig
Jakub Konka 2875216f8e test: fix x86_64-macos failures
This is just a temporary fix - I would like to unify all of x86_64
tests across linux and macos OSes.
2022-04-28 18:35:01 +02:00

23 lines
376 B
Zig

fn assert(ok: bool) void {
if (!ok) unreachable;
}
fn foo(ok: bool) i32 {
const val: i32 = blk: {
var x: i32 = 1;
if (!ok) break :blk x + 9;
break :blk x + 19;
};
return val + 10;
}
pub fn main() void {
assert(foo(false) == 20);
assert(foo(true) == 30);
}
// run
// backend=stage2,llvm
// target=x86_64-linux,x86_64-macos
//