zig/test/behavior/bugs/1381.zig
Robin Voetter faad97edff
spirv: update failing / passing tests
Some tests are now failing due to debug info changes, some tests
now pass due to improved compiler functionality.
2023-10-15 20:08:18 +02:00

27 lines
600 B
Zig

const std = @import("std");
const builtin = @import("builtin");
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" {
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
var as = [_]A{
A{ .B = B{ .D = 1 } },
A{ .B = B{ .D = 1 } },
};
const a = as[0].B;
try std.testing.expect(a.D == 1);
}