1export fn entry1() void {
2 _ = @sizeOf(packed struct(u32) {
3 x: u1,
4 y: u24,
5 z: u4,
6 });
7}
8export fn entry2() void {
9 _ = @sizeOf(packed struct(i31) {
10 x: u4,
11 y: u24,
12 z: u4,
13 });
14}
15
16export fn entry3() void {
17 _ = @sizeOf(packed struct(void) {
18 x: void,
19 });
20}
21
22export fn entry4() void {
23 _ = @sizeOf(packed struct(void) {});
24}
25
26export fn entry5() void {
27 _ = @sizeOf(packed struct(noreturn) {});
28}
29
30export fn entry6() void {
31 _ = @sizeOf(packed struct(f64) {
32 x: u32,
33 y: f32,
34 });
35}
36
37export fn entry7() void {
38 _ = @sizeOf(packed struct(*u32) {
39 x: u4,
40 y: u24,
41 z: u4,
42 });
43}
44
45// error
46//
47// :2:24: error: backing integer bit width does not match total bit width of fields
48// :2:31: note: backing integer 'u32' has bit width '32'
49// :2:24: note: struct fields have total bit width '29'
50// :9:24: error: backing integer bit width does not match total bit width of fields
51// :9:31: note: backing integer 'i31' has bit width '31'
52// :9:24: note: struct fields have total bit width '32'
53// :17:31: error: expected backing integer type, found 'void'
54// :23:31: error: expected backing integer type, found 'void'
55// :27:31: error: expected backing integer type, found 'noreturn'
56// :31:31: error: expected backing integer type, found 'f64'
57// :38:31: error: expected backing integer type, found '*u32'