mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
behavior: add testing for LLVM SROA bugs
This commit is contained in:
parent
59375b3c22
commit
89cac88e91
@ -2042,3 +2042,20 @@ test "circular dependency through pointer field of a union" {
|
||||
try expect(outer.u.outer == null);
|
||||
try expect(outer.u.inner == null);
|
||||
}
|
||||
|
||||
test "pass nested union with rls" {
|
||||
const Union = union(enum) {
|
||||
a: u32,
|
||||
b: union(enum) {
|
||||
c: u7,
|
||||
d: u3,
|
||||
},
|
||||
|
||||
fn getC(u: @This()) u7 {
|
||||
return u.b.c;
|
||||
}
|
||||
};
|
||||
|
||||
var c: u7 = 32;
|
||||
try expectEqual(@as(u7, 32), Union.getC(.{ .b = .{ .c = c } }));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user