| 1 | const E = enum(u32) { x }; |
| 2 | export fn entry1() void { |
| 3 | @compileLog(@as(E, @fromBackingInt(undefined))); |
| 4 | } |
| 5 | |
| 6 | const S = packed struct(u32) { x: u32 }; |
| 7 | export fn entry2() void { |
| 8 | @compileLog(@as(S, @fromBackingInt(undefined))); |
| 9 | } |
| 10 | |
| 11 | const U = packed union(u32) { x: u32 }; |
| 12 | export fn entry3() void { |
| 13 | @compileLog(@as(U, @fromBackingInt(undefined))); |
| 14 | } |
| 15 | |
| 16 | // error |
| 17 | // |
| 18 | // :3:40: error: use of undefined value here causes illegal behavior |
| 19 | // |
| 20 | // Compile Log Output: |
| 21 | // @as(tmp.S, undefined) |
| 22 | // @as(tmp.U, undefined) |