| 1 | export fn foo() void { |
| 2 | comptime var a: u32 = 0; |
| 3 | asm volatile ("" |
| 4 | : |
| 5 | : [in] "r" (&a), |
| 6 | ); |
| 7 | } |
| 8 | |
| 9 | export fn bar() void { |
| 10 | comptime var a: u32 = 0; |
| 11 | asm volatile ("" |
| 12 | : [out] "=r" (a), |
| 13 | ); |
| 14 | } |
| 15 | |
| 16 | // error |
| 17 | // |
| 18 | // :5:21: error: assembly input contains reference to comptime var |
| 19 | // :2:14: note: 'in' points to comptime var declared here |
| 20 | // :12:23: error: assembly output contains reference to comptime var |
| 21 | // :10:14: note: 'out' points to comptime var declared here |