From 5e7406bdd9f942900dceb2f917ed5f64b6f2ba00 Mon Sep 17 00:00:00 2001 From: g-w1 <58830309+g-w1@users.noreply.github.com> Date: Thu, 30 Sep 2021 18:31:27 -0400 Subject: stage2: implement array_init instruction (#9843) * stage2: array mul support more types of operands * stage2: array cat support more types of operands * print_zir: print array_init * stage2: implement Sema for array_init --- test/behavior/array.zig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/behavior/array.zig') diff --git a/test/behavior/array.zig b/test/behavior/array.zig index 8cf0042d5f..8250cdea06 100644 --- a/test/behavior/array.zig +++ b/test/behavior/array.zig @@ -27,3 +27,9 @@ test "arrays" { fn getArrayLen(a: []const u32) usize { return a.len; } + +test "array init with mult" { + const a = 'a'; + var i: [8]u8 = [2]u8{ a, 'b' } ** 4; + try expect(std.mem.eql(u8, &i, "abababab")); +} -- cgit v1.2.3