authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-26 17:11:49-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-26 17:21:20-07:00
log00d6a4da4981a026222e387fe18915ab45e5c11d
tree17f21b45ad92a879965aca883c63c4fb8e74e72e
parent1aacfa7186187ed467a5e3189a877493d5c620a1

add behavior test for comptime array load

closes #8487

1 files changed, 10 insertions(+), 0 deletions(-)

test/behavior/eval.zig+10
......@@ -1703,3 +1703,13 @@ test "@inComptime" {
17031703 try expectEqual(false, S.inComptime());
17041704 try expectEqual(true, comptime S.inComptime());
17051705}
1706
1707// comptime partial array assign
1708comptime {
1709 var foo = [3]u8{ 0x55, 0x55, 0x55 };
1710 var bar = [2]u8{ 1, 2 };
1711 foo[0..2].* = bar;
1712 assert(foo[0] == 1);
1713 assert(foo[1] == 2);
1714 assert(foo[2] == 0x55);
1715}