| ... | @@ -167,6 +167,31 @@ test "array to vector" { | ... | @@ -167,6 +167,31 @@ test "array to vector" { |
| 167 | comptime try S.doTheTest(); | 167 | comptime try S.doTheTest(); |
| 168 | } | 168 | } |
| 169 | | 169 | |
| | 170 | test "tuple to vector" { |
| | 171 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| | 172 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| | 173 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| | 174 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| | 175 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| | 176 | |
| | 177 | const S = struct { |
| | 178 | fn doTheTest() !void { |
| | 179 | const Vec3 = @Vector(3, i32); |
| | 180 | var v: Vec3 = .{ 1, 0, 0 }; |
| | 181 | for ([_]Vec3{ .{ 0, 1, 0 }, .{ 0, 0, 1 } }) |it| { |
| | 182 | v += it; |
| | 183 | } |
| | 184 | |
| | 185 | try std.testing.expectEqual(v, Vec3{ 1, 1, 1 }); |
| | 186 | if (builtin.zig_backend != .stage1) { |
| | 187 | try std.testing.expectEqual(v, .{ 1, 1, 1 }); |
| | 188 | } |
| | 189 | } |
| | 190 | }; |
| | 191 | try S.doTheTest(); |
| | 192 | comptime try S.doTheTest(); |
| | 193 | } |
| | 194 | |
| 170 | test "vector casts of sizes not divisible by 8" { | 195 | test "vector casts of sizes not divisible by 8" { |
| 171 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO | 196 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| 172 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO | 197 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |