zig/test/behavior/bugs/1381.zig
Andrew Kelley 4307436b99 move behavior tests from test/stage1/ to test/
And fix test cases to make them pass. This is in preparation for
starting to pass behavior tests with self-hosted.
2021-04-29 15:54:04 -07:00

22 lines
333 B
Zig

const std = @import("std");
const B = union(enum) {
D: u8,
E: u16,
};
const A = union(enum) {
B: B,
C: u8,
};
test "union that needs padding bytes inside an array" {
var as = [_]A{
A{ .B = B{ .D = 1 } },
A{ .B = B{ .D = 1 } },
};
const a = as[0].B;
std.testing.expect(a.D == 1);
}