| ... | @@ -3,6 +3,7 @@ const builtin = @import("builtin"); | ... | @@ -3,6 +3,7 @@ const builtin = @import("builtin"); |
| 3 | const mem = std.mem; | 3 | const mem = std.mem; |
| 4 | const math = std.math; | 4 | const math = std.math; |
| 5 | const expect = std.testing.expect; | 5 | const expect = std.testing.expect; |
| | 6 | const expectEqual = std.testing.expectEqual; |
| 6 | | 7 | |
| 7 | test "implicit cast vector to array - bool" { | 8 | test "implicit cast vector to array - bool" { |
| 8 | if (builtin.zig_backend == .stage1) { | 9 | if (builtin.zig_backend == .stage1) { |
| ... | @@ -1231,3 +1232,17 @@ test "modRem with zero divisor" { | ... | @@ -1231,3 +1232,17 @@ test "modRem with zero divisor" { |
| 1231 | _ = zeros[0]; | 1232 | _ = zeros[0]; |
| 1232 | } | 1233 | } |
| 1233 | } | 1234 | } |
| | 1235 | |
| | 1236 | test "array operands to shuffle are coerced to vectors" { |
| | 1237 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| | 1238 | if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO |
| | 1239 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| | 1240 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| | 1241 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| | 1242 | |
| | 1243 | const mask = [5]i32{ -1, 0, 1, 2, 3 }; |
| | 1244 | |
| | 1245 | var a = [5]u32{ 3, 5, 7, 9, 0 }; |
| | 1246 | var b = @shuffle(u32, a, @splat(5, @as(u24, 0)), mask); |
| | 1247 | try expectEqual([_]u32{ 0, 3, 5, 7, 9 }, b); |
| | 1248 | } |