| 1 | const globl = g: { |
| 2 | @branchHint(.none); |
| 3 | break :g {}; |
| 4 | }; |
| 5 | |
| 6 | comptime { |
| 7 | @branchHint(.none); |
| 8 | } |
| 9 | |
| 10 | test { |
| 11 | @branchHint(.none); |
| 12 | } |
| 13 | |
| 14 | export fn foo() void { |
| 15 | { |
| 16 | @branchHint(.none); |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | export fn bar() void { |
| 21 | _ = (b: { |
| 22 | @branchHint(.none); |
| 23 | break :b true; |
| 24 | }) or true; |
| 25 | } |
| 26 | |
| 27 | export fn qux() void { |
| 28 | (b: { |
| 29 | @branchHint(.none); |
| 30 | break :b @as(?void, {}); |
| 31 | }) orelse unreachable; |
| 32 | } |
| 33 | |
| 34 | // error |
| 35 | // |
| 36 | // :2:5: error: '@branchHint' outside function scope |
| 37 | // :7:5: error: '@branchHint' outside function scope |
| 38 | // :11:5: error: '@branchHint' must appear as the first statement in a function or conditional branch |
| 39 | // :16:9: error: '@branchHint' must appear as the first statement in a function or conditional branch |
| 40 | // :22:9: error: '@branchHint' must appear as the first statement in a function or conditional branch |
| 41 | // :29:9: error: '@branchHint' must appear as the first statement in a function or conditional branch |