| ... | @@ -1440,3 +1440,28 @@ test "boolean vector with 2 or more booleans" { | ... | @@ -1440,3 +1440,28 @@ test "boolean vector with 2 or more booleans" { |
| 1440 | const vec2 = @Vector(3, bool){ true, true, true }; | 1440 | const vec2 = @Vector(3, bool){ true, true, true }; |
| 1441 | _ = vec2; | 1441 | _ = vec2; |
| 1442 | } | 1442 | } |
| | 1443 | |
| | 1444 | test "bitcast to vector with different child type" { |
| | 1445 | if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO |
| | 1446 | if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO |
| | 1447 | if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO |
| | 1448 | if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO |
| | 1449 | if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO |
| | 1450 | if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest; // TODO |
| | 1451 | |
| | 1452 | const S = struct { |
| | 1453 | fn doTheTest() !void { |
| | 1454 | const VecA = @Vector(8, u16); |
| | 1455 | const VecB = @Vector(4, u32); |
| | 1456 | |
| | 1457 | var vec_a = VecA{ 1, 1, 1, 1, 1, 1, 1, 1 }; |
| | 1458 | var vec_b: VecB = @bitCast(vec_a); |
| | 1459 | var vec_c: VecA = @bitCast(vec_b); |
| | 1460 | try expectEqual(vec_a, vec_c); |
| | 1461 | } |
| | 1462 | }; |
| | 1463 | |
| | 1464 | // Originally reported at https://github.com/ziglang/zig/issues/8184 |
| | 1465 | try S.doTheTest(); |
| | 1466 | try comptime S.doTheTest(); |
| | 1467 | } |