mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
- implements `airSlice`, `airBitAnd`, `airBitOr`, `airShr`. - got a basic design going for the `airErrorName` but for some reason it simply returns empty bytes. will investigate further. - only generating `.got.zig` entries when not compiling an object or shared library - reduced the total amount of ops a mnemonic can have to 3, simplifying the logic
33 lines
535 B
Zig
33 lines
535 B
Zig
const builtin = @import("builtin");
|
|
const expect = @import("std").testing.expect;
|
|
|
|
const A = struct {
|
|
b: B,
|
|
};
|
|
|
|
const B = struct {
|
|
c: C,
|
|
};
|
|
|
|
const C = struct {
|
|
x: i32,
|
|
|
|
fn d(c: *const C) i32 {
|
|
return c.x;
|
|
}
|
|
};
|
|
|
|
fn foo(a: A) i32 {
|
|
return a.b.c.d();
|
|
}
|
|
|
|
test "incomplete struct param top level declaration" {
|
|
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
|
|
|
const a = A{
|
|
.b = B{
|
|
.c = C{ .x = 13 },
|
|
},
|
|
};
|
|
try expect(foo(a) == 13);
|
|
}
|