#zig build-obj {
--name test -fno-emit-bin
-Mroot=test.zig
#}

#write test.zig {
export fn entry1() void {
    _ = @sizeOf(packed struct(u32) {
        x: u1,
        y: u24,
        z: u4,
    });
}
export fn entry2() void {
    _ = @sizeOf(packed struct(i31) {
        x: u4,
        y: u24,
        z: u4,
    });
}

export fn entry3() void {
    _ = @sizeOf(packed struct(void) {
        x: void,
    });
}

export fn entry4() void {
    _ = @sizeOf(packed struct(void) {});
}

export fn entry5() void {
    _ = @sizeOf(packed struct(noreturn) {});
}

export fn entry6() void {
    _ = @sizeOf(packed struct(f64) {
        x: u32,
        y: f32,
    });
}

export fn entry7() void {
    _ = @sizeOf(packed struct(*u32) {
        x: u4,
        y: u24,
        z: u4,
    });
}
#}
#update
#check errors {
test.zig:2:24: error: backing integer bit width does not match total bit width of fields
test.zig:2:31: note: backing integer 'u32' has bit width '32'
test.zig:2:24: note: struct fields have total bit width '29'
test.zig:9:24: error: backing integer bit width does not match total bit width of fields
test.zig:9:31: note: backing integer 'i31' has bit width '31'
test.zig:9:24: note: struct fields have total bit width '32'
test.zig:17:31: error: expected backing integer type, found 'void'
test.zig:23:31: error: expected backing integer type, found 'void'
test.zig:27:31: error: expected backing integer type, found 'noreturn'
test.zig:31:31: error: expected backing integer type, found 'f64'
test.zig:38:31: error: expected backing integer type, found '*u32'
#}
