master
1fn assert(ok: bool) void {
2 if (!ok) unreachable;
3}
4
5fn foo(ok: bool) i32 {
6 var val: i32 = blk: {
7 const val2: i32 = another: {
8 if (!ok) break :blk 10;
9 break :another 10;
10 };
11 break :blk val2 + 10;
12 };
13 return (&val).*;
14}
15
16pub fn main() void {
17 assert(foo(false) == 10);
18 assert(foo(true) == 20);
19}
20
21// run
22// backend=selfhosted,llvm
23// target=x86_64-linux,x86_64-macos
24//