diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-05-28 18:38:35 +0300 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2022-05-29 13:19:03 +0300 |
| commit | c7b778992ec539e237d8afa7c105dcbad7ee280c (patch) | |
| tree | d8e9e03fd9f84ad3a8a6439a82972806ed8bc914 /test/behavior | |
| parent | ee651c3cd358f40f60db0bbcd82ffde99aed9b88 (diff) | |
| download | zig-c7b778992ec539e237d8afa7c105dcbad7ee280c.tar.gz zig-c7b778992ec539e237d8afa7c105dcbad7ee280c.zip | |
AstGen: improve generated Zir for array init exprs
Diffstat (limited to 'test/behavior')
| -rw-r--r-- | test/behavior/basic.zig | 7 | ||||
| -rw-r--r-- | test/behavior/tuple.zig | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/test/behavior/basic.zig b/test/behavior/basic.zig index ac9e776c76..11ecf089c5 100644 --- a/test/behavior/basic.zig +++ b/test/behavior/basic.zig @@ -942,3 +942,10 @@ test "comptime int in switch in catch is casted to correct inferred type" { }; _ = b; } + +test "vector initialized with array init syntax has proper type" { + comptime { + const actual = -@Vector(4, i32){ 1, 2, 3, 4 }; + try std.testing.expectEqual(@Vector(4, i32){ -1, -2, -3, -4 }, actual); + } +} diff --git a/test/behavior/tuple.zig b/test/behavior/tuple.zig index 5e044abf4f..f9237bb230 100644 --- a/test/behavior/tuple.zig +++ b/test/behavior/tuple.zig @@ -194,8 +194,6 @@ test "tuple as the result from a labeled block" { } test "initializing tuple with explicit type" { - if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO - const T = @TypeOf(.{ @as(i32, 0), @as(u32, 0) }); var a = T{ 0, 0 }; _ = a; |
