aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/basic.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/behavior/basic.zig')
-rw-r--r--test/behavior/basic.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/behavior/basic.zig b/test/behavior/basic.zig
index 073be26288..5b8ca80198 100644
--- a/test/behavior/basic.zig
+++ b/test/behavior/basic.zig
@@ -1145,3 +1145,10 @@ test "arrays and vectors with big integers" {
try expect(b[0] == comptime std.math.maxInt(Int));
}
}
+
+test "pointer to struct literal with runtime field is constant" {
+ const S = struct { data: usize };
+ var runtime_zero: usize = 0;
+ const ptr = &S{ .data = runtime_zero };
+ try expect(@typeInfo(@TypeOf(ptr)).Pointer.is_const);
+}