zig/test/behavior/incomplete_struct_param_tld.zig
David Rubin 05de6c279b
riscv: std.fmt.format running
- 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
2024-06-13 02:20:47 -07:00

34 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);
}