aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/extern_struct_zero_size_fields.zig
blob: 1b13532f11e72a6b847538338679a876e9cba4ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const E = enum(u0) {
    the_only_possible_value,
};

const S = struct {};

const T = extern struct {
    foo: u0 = 0,
    bar: void = {},
    baz: struct {} = .{},
    ayy: E = .the_only_possible_value,
    arr: [0]u0 = .{},
    matey: [128]void = [_]void{{}} ** 128,
    running_out_of_ideas: packed struct {} = .{},
    one_more: [256]S = [_]S{.{}} ** 256,
};

test {
    var t: T = .{};
    _ = t;
}