| 1 | export fn entry1() void { |
| 2 | const S = extern struct { x: u32 }; |
| 3 | _ = *align(1:2:8) S; |
| 4 | } |
| 5 | |
| 6 | export fn entry2() void { |
| 7 | const S = struct { x: u32 }; |
| 8 | _ = *align(1:2:@sizeOf(S) * 2) S; |
| 9 | } |
| 10 | |
| 11 | export fn entry3() void { |
| 12 | const E = enum { implicit, backing, type }; |
| 13 | _ = *align(1:2:8) E; |
| 14 | } |
| 15 | |
| 16 | // error |
| 17 | // |
| 18 | // :3:23: error: bit-pointer cannot refer to value of type 'tmp.entry1.S' |
| 19 | // :3:23: note: non-packed structs do not have a bit-packed representation |
| 20 | // :2:22: note: struct declared here |
| 21 | // :8:36: error: bit-pointer cannot refer to value of type 'tmp.entry2.S' |
| 22 | // :8:36: note: non-packed structs do not have a bit-packed representation |
| 23 | // :7:15: note: struct declared here |
| 24 | // :13:23: error: bit-pointer cannot refer to value of type 'tmp.entry3.E' |
| 25 | // :12:15: note: integer tag type of enum is inferred |
| 26 | // :12:15: note: consider explicitly specifying the integer tag type |