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
This commit is contained in:
@@ -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"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user