aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/struct.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2024-02-15 02:26:32 +0100
committerAndrew Kelley <andrew@ziglang.org>2024-02-15 02:46:18 -0800
commit6fe90a913a8876e78692d5e89652559f72e7644f (patch)
tree94c14895d96b669ed2f9d10d95a68f746dd73b5a /test/behavior/struct.zig
parentc280811d1d5b5d73e1eb4243c577f86375447e99 (diff)
downloadzig-6fe90a913a8876e78692d5e89652559f72e7644f.tar.gz
zig-6fe90a913a8876e78692d5e89652559f72e7644f.zip
llvm: fix lowering of recursive debug info
This change allows recursing over types that are currently being resolved fully with a second pass of forward resolution. Closes #16414
Diffstat (limited to 'test/behavior/struct.zig')
-rw-r--r--test/behavior/struct.zig12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/behavior/struct.zig b/test/behavior/struct.zig
index 37d201288a..c6f8730987 100644
--- a/test/behavior/struct.zig
+++ b/test/behavior/struct.zig
@@ -2114,3 +2114,15 @@ test "initiate global variable with runtime value" {
};
try expect(S.some_struct.field == 1);
}
+
+test "struct containing optional pointer to array of @This()" {
+ if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
+
+ const S = struct {
+ x: ?*const [1]@This(),
+ };
+
+ var s: S = .{ .x = &.{.{ .x = null }} };
+ _ = &s;
+ try expect(s.x.?[0].x == null);
+}