aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/array.zig
diff options
context:
space:
mode:
authorXavier Bouchoux <xavierb@gmail.com>2023-03-19 12:56:37 +0000
committerVeikka Tuominen <git@vexu.eu>2023-03-21 14:56:04 +0200
commit898e4473e8acf664d67474716bb9728ed601c5a0 (patch)
tree3362d654440ad5aee89b1811a53f9fe9a77d30c5 /test/behavior/array.zig
parentf7204c7f37ee69462b9ad41a76454831e0df09d0 (diff)
downloadzig-898e4473e8acf664d67474716bb9728ed601c5a0.tar.gz
zig-898e4473e8acf664d67474716bb9728ed601c5a0.zip
CBE: implement aggregateInit() for array of array case.
fixes `error(compilation): clang failed with stderr: error: array type 'uint32_t[10]' (aka 'unsigned int[10]') is not assignable`
Diffstat (limited to 'test/behavior/array.zig')
-rw-r--r--test/behavior/array.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/behavior/array.zig b/test/behavior/array.zig
index c78bf4ab85..484cab4722 100644
--- a/test/behavior/array.zig
+++ b/test/behavior/array.zig
@@ -669,3 +669,13 @@ test "runtime initialized sentinel-terminated array literal" {
try std.testing.expect(g[2] == 0x99);
try std.testing.expect(g[3] == 0x99);
}
+
+test "array of array agregate init" {
+ if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
+ if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
+ if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
+
+ var a = [1]u32{11} ** 10;
+ var b = [1][10]u32{a} ** 2;
+ try std.testing.expect(b[1][1] == 11);
+}