aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/array.zig
diff options
context:
space:
mode:
authorVeikka Tuominen <git@vexu.eu>2022-12-31 14:28:21 +0200
committerAndrew Kelley <andrew@ziglang.org>2022-12-31 20:49:02 -0500
commit58c1d98c1463210135ab7f405d204b0769525328 (patch)
treef174445e9c623e4d367f65f05aaa1ee71fe2d0c4 /test/behavior/array.zig
parent1c711b0a64a7bd13e5be80dfc107cba9cc9bedc4 (diff)
downloadzig-58c1d98c1463210135ab7f405d204b0769525328.tar.gz
zig-58c1d98c1463210135ab7f405d204b0769525328.zip
add tests for fixed stage1 bugs
Closes #4144 Closes #4255 Closes #4372 Closes #4375 Closes #4380 Closes #4417 Closes #4423 Closes #4476 Closes #4528 Closes #4562 Closes #4572 Closes #4597 Closes #4639 Closes #4672 Closes #4782 Closes #4955 Closes #4984 Closes #4997 Closes #5010 Closes #5114 Closes #5166 Closes #5173 Closes #5276
Diffstat (limited to 'test/behavior/array.zig')
-rw-r--r--test/behavior/array.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/behavior/array.zig b/test/behavior/array.zig
index 52a4d7512a..012e078531 100644
--- a/test/behavior/array.zig
+++ b/test/behavior/array.zig
@@ -654,3 +654,11 @@ test "array init of container level array variable" {
S.bar(5, 6);
try expectEqual([2]usize{ 5, 6 }, S.pair);
}
+
+test "runtime initialized sentinel-terminated array literal" {
+ var c: u16 = 300;
+ const f = &[_:0x9999]u16{c};
+ const g = @ptrCast(*[4]u8, f);
+ try std.testing.expect(g[2] == 0x99);
+ try std.testing.expect(g[3] == 0x99);
+}