| ... | @@ -8,6 +8,7 @@ const expectApproxEqRel = std.testing.expectApproxEqRel; | ... | @@ -8,6 +8,7 @@ const expectApproxEqRel = std.testing.expectApproxEqRel; |
| 8 | const Vector = std.meta.Vector; | 8 | const Vector = std.meta.Vector; |
| 9 | | 9 | |
| 10 | test "implicit cast vector to array - bool" { | 10 | test "implicit cast vector to array - bool" { |
| | 11 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 11 | const S = struct { | 12 | const S = struct { |
| 12 | fn doTheTest() !void { | 13 | fn doTheTest() !void { |
| 13 | const a: Vector(4, bool) = [_]bool{ true, false, true, false }; | 14 | const a: Vector(4, bool) = [_]bool{ true, false, true, false }; |
| ... | @@ -20,6 +21,7 @@ test "implicit cast vector to array - bool" { | ... | @@ -20,6 +21,7 @@ test "implicit cast vector to array - bool" { |
| 20 | } | 21 | } |
| 21 | | 22 | |
| 22 | test "vector wrap operators" { | 23 | test "vector wrap operators" { |
| | 24 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 23 | const S = struct { | 25 | const S = struct { |
| 24 | fn doTheTest() !void { | 26 | fn doTheTest() !void { |
| 25 | var v: Vector(4, i32) = [4]i32{ 2147483647, -2, 30, 40 }; | 27 | var v: Vector(4, i32) = [4]i32{ 2147483647, -2, 30, 40 }; |
| ... | @@ -36,6 +38,7 @@ test "vector wrap operators" { | ... | @@ -36,6 +38,7 @@ test "vector wrap operators" { |
| 36 | } | 38 | } |
| 37 | | 39 | |
| 38 | test "vector bin compares with mem.eql" { | 40 | test "vector bin compares with mem.eql" { |
| | 41 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 39 | const S = struct { | 42 | const S = struct { |
| 40 | fn doTheTest() !void { | 43 | fn doTheTest() !void { |
| 41 | var v: Vector(4, i32) = [4]i32{ 2147483647, -2, 30, 40 }; | 44 | var v: Vector(4, i32) = [4]i32{ 2147483647, -2, 30, 40 }; |
| ... | @@ -53,6 +56,7 @@ test "vector bin compares with mem.eql" { | ... | @@ -53,6 +56,7 @@ test "vector bin compares with mem.eql" { |
| 53 | } | 56 | } |
| 54 | | 57 | |
| 55 | test "vector int operators" { | 58 | test "vector int operators" { |
| | 59 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 56 | const S = struct { | 60 | const S = struct { |
| 57 | fn doTheTest() !void { | 61 | fn doTheTest() !void { |
| 58 | var v: Vector(4, i32) = [4]i32{ 10, 20, 30, 40 }; | 62 | var v: Vector(4, i32) = [4]i32{ 10, 20, 30, 40 }; |
| ... | @@ -68,6 +72,7 @@ test "vector int operators" { | ... | @@ -68,6 +72,7 @@ test "vector int operators" { |
| 68 | } | 72 | } |
| 69 | | 73 | |
| 70 | test "vector float operators" { | 74 | test "vector float operators" { |
| | 75 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 71 | const S = struct { | 76 | const S = struct { |
| 72 | fn doTheTest() !void { | 77 | fn doTheTest() !void { |
| 73 | var v: Vector(4, f32) = [4]f32{ 10, 20, 30, 40 }; | 78 | var v: Vector(4, f32) = [4]f32{ 10, 20, 30, 40 }; |
| ... | @@ -83,6 +88,7 @@ test "vector float operators" { | ... | @@ -83,6 +88,7 @@ test "vector float operators" { |
| 83 | } | 88 | } |
| 84 | | 89 | |
| 85 | test "vector bit operators" { | 90 | test "vector bit operators" { |
| | 91 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 86 | const S = struct { | 92 | const S = struct { |
| 87 | fn doTheTest() !void { | 93 | fn doTheTest() !void { |
| 88 | var v: Vector(4, u8) = [4]u8{ 0b10101010, 0b10101010, 0b10101010, 0b10101010 }; | 94 | var v: Vector(4, u8) = [4]u8{ 0b10101010, 0b10101010, 0b10101010, 0b10101010 }; |
| ... | @@ -97,6 +103,7 @@ test "vector bit operators" { | ... | @@ -97,6 +103,7 @@ test "vector bit operators" { |
| 97 | } | 103 | } |
| 98 | | 104 | |
| 99 | test "implicit cast vector to array" { | 105 | test "implicit cast vector to array" { |
| | 106 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 100 | const S = struct { | 107 | const S = struct { |
| 101 | fn doTheTest() !void { | 108 | fn doTheTest() !void { |
| 102 | var a: Vector(4, i32) = [_]i32{ 1, 2, 3, 4 }; | 109 | var a: Vector(4, i32) = [_]i32{ 1, 2, 3, 4 }; |
| ... | @@ -110,6 +117,7 @@ test "implicit cast vector to array" { | ... | @@ -110,6 +117,7 @@ test "implicit cast vector to array" { |
| 110 | } | 117 | } |
| 111 | | 118 | |
| 112 | test "array to vector" { | 119 | test "array to vector" { |
| | 120 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 113 | var foo: f32 = 3.14; | 121 | var foo: f32 = 3.14; |
| 114 | var arr = [4]f32{ foo, 1.5, 0.0, 0.0 }; | 122 | var arr = [4]f32{ foo, 1.5, 0.0, 0.0 }; |
| 115 | var vec: Vector(4, f32) = arr; | 123 | var vec: Vector(4, f32) = arr; |
| ... | @@ -117,6 +125,7 @@ test "array to vector" { | ... | @@ -117,6 +125,7 @@ test "array to vector" { |
| 117 | } | 125 | } |
| 118 | | 126 | |
| 119 | test "vector casts of sizes not divisible by 8" { | 127 | test "vector casts of sizes not divisible by 8" { |
| | 128 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 120 | const S = struct { | 129 | const S = struct { |
| 121 | fn doTheTest() !void { | 130 | fn doTheTest() !void { |
| 122 | { | 131 | { |
| ... | @@ -146,6 +155,7 @@ test "vector casts of sizes not divisible by 8" { | ... | @@ -146,6 +155,7 @@ test "vector casts of sizes not divisible by 8" { |
| 146 | } | 155 | } |
| 147 | | 156 | |
| 148 | test "vector @splat" { | 157 | test "vector @splat" { |
| | 158 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 149 | const S = struct { | 159 | const S = struct { |
| 150 | fn testForT(comptime N: comptime_int, v: anytype) !void { | 160 | fn testForT(comptime N: comptime_int, v: anytype) !void { |
| 151 | const T = @TypeOf(v); | 161 | const T = @TypeOf(v); |
| ... | @@ -181,6 +191,7 @@ test "vector @splat" { | ... | @@ -181,6 +191,7 @@ test "vector @splat" { |
| 181 | } | 191 | } |
| 182 | | 192 | |
| 183 | test "load vector elements via comptime index" { | 193 | test "load vector elements via comptime index" { |
| | 194 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 184 | const S = struct { | 195 | const S = struct { |
| 185 | fn doTheTest() !void { | 196 | fn doTheTest() !void { |
| 186 | var v: Vector(4, i32) = [_]i32{ 1, 2, 3, undefined }; | 197 | var v: Vector(4, i32) = [_]i32{ 1, 2, 3, undefined }; |
| ... | @@ -198,6 +209,7 @@ test "load vector elements via comptime index" { | ... | @@ -198,6 +209,7 @@ test "load vector elements via comptime index" { |
| 198 | } | 209 | } |
| 199 | | 210 | |
| 200 | test "store vector elements via comptime index" { | 211 | test "store vector elements via comptime index" { |
| | 212 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 201 | const S = struct { | 213 | const S = struct { |
| 202 | fn doTheTest() !void { | 214 | fn doTheTest() !void { |
| 203 | var v: Vector(4, i32) = [_]i32{ 1, 5, 3, undefined }; | 215 | var v: Vector(4, i32) = [_]i32{ 1, 5, 3, undefined }; |
| ... | @@ -221,6 +233,7 @@ test "store vector elements via comptime index" { | ... | @@ -221,6 +233,7 @@ test "store vector elements via comptime index" { |
| 221 | } | 233 | } |
| 222 | | 234 | |
| 223 | test "load vector elements via runtime index" { | 235 | test "load vector elements via runtime index" { |
| | 236 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 224 | const S = struct { | 237 | const S = struct { |
| 225 | fn doTheTest() !void { | 238 | fn doTheTest() !void { |
| 226 | var v: Vector(4, i32) = [_]i32{ 1, 2, 3, undefined }; | 239 | var v: Vector(4, i32) = [_]i32{ 1, 2, 3, undefined }; |
| ... | @@ -238,6 +251,7 @@ test "load vector elements via runtime index" { | ... | @@ -238,6 +251,7 @@ test "load vector elements via runtime index" { |
| 238 | } | 251 | } |
| 239 | | 252 | |
| 240 | test "store vector elements via runtime index" { | 253 | test "store vector elements via runtime index" { |
| | 254 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 241 | const S = struct { | 255 | const S = struct { |
| 242 | fn doTheTest() !void { | 256 | fn doTheTest() !void { |
| 243 | var v: Vector(4, i32) = [_]i32{ 1, 5, 3, undefined }; | 257 | var v: Vector(4, i32) = [_]i32{ 1, 5, 3, undefined }; |
| ... | @@ -256,6 +270,7 @@ test "store vector elements via runtime index" { | ... | @@ -256,6 +270,7 @@ test "store vector elements via runtime index" { |
| 256 | } | 270 | } |
| 257 | | 271 | |
| 258 | test "initialize vector which is a struct field" { | 272 | test "initialize vector which is a struct field" { |
| | 273 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 259 | const Vec4Obj = struct { | 274 | const Vec4Obj = struct { |
| 260 | data: Vector(4, f32), | 275 | data: Vector(4, f32), |
| 261 | }; | 276 | }; |
| ... | @@ -273,6 +288,7 @@ test "initialize vector which is a struct field" { | ... | @@ -273,6 +288,7 @@ test "initialize vector which is a struct field" { |
| 273 | } | 288 | } |
| 274 | | 289 | |
| 275 | test "vector comparison operators" { | 290 | test "vector comparison operators" { |
| | 291 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 276 | const S = struct { | 292 | const S = struct { |
| 277 | fn doTheTest() !void { | 293 | fn doTheTest() !void { |
| 278 | { | 294 | { |
| ... | @@ -307,6 +323,7 @@ test "vector comparison operators" { | ... | @@ -307,6 +323,7 @@ test "vector comparison operators" { |
| 307 | } | 323 | } |
| 308 | | 324 | |
| 309 | test "vector division operators" { | 325 | test "vector division operators" { |
| | 326 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 310 | const S = struct { | 327 | const S = struct { |
| 311 | fn doTheTestDiv(comptime T: type, x: Vector(4, T), y: Vector(4, T)) !void { | 328 | fn doTheTestDiv(comptime T: type, x: Vector(4, T), y: Vector(4, T)) !void { |
| 312 | if (!comptime std.meta.trait.isSignedInt(T)) { | 329 | if (!comptime std.meta.trait.isSignedInt(T)) { |
| ... | @@ -389,6 +406,7 @@ test "vector division operators" { | ... | @@ -389,6 +406,7 @@ test "vector division operators" { |
| 389 | } | 406 | } |
| 390 | | 407 | |
| 391 | test "vector bitwise not operator" { | 408 | test "vector bitwise not operator" { |
| | 409 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 392 | const S = struct { | 410 | const S = struct { |
| 393 | fn doTheTestNot(comptime T: type, x: Vector(4, T)) !void { | 411 | fn doTheTestNot(comptime T: type, x: Vector(4, T)) !void { |
| 394 | var y = ~x; | 412 | var y = ~x; |
| ... | @@ -414,6 +432,7 @@ test "vector bitwise not operator" { | ... | @@ -414,6 +432,7 @@ test "vector bitwise not operator" { |
| 414 | } | 432 | } |
| 415 | | 433 | |
| 416 | test "vector shift operators" { | 434 | test "vector shift operators" { |
| | 435 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 417 | const S = struct { | 436 | const S = struct { |
| 418 | fn doTheTestShift(x: anytype, y: anytype) !void { | 437 | fn doTheTestShift(x: anytype, y: anytype) !void { |
| 419 | const N = @typeInfo(@TypeOf(x)).Array.len; | 438 | const N = @typeInfo(@TypeOf(x)).Array.len; |
| ... | @@ -501,6 +520,7 @@ test "vector shift operators" { | ... | @@ -501,6 +520,7 @@ test "vector shift operators" { |
| 501 | } | 520 | } |
| 502 | | 521 | |
| 503 | test "vector reduce operation" { | 522 | test "vector reduce operation" { |
| | 523 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 504 | const S = struct { | 524 | const S = struct { |
| 505 | fn doTheTestReduce(comptime op: std.builtin.ReduceOp, x: anytype, expected: anytype) !void { | 525 | fn doTheTestReduce(comptime op: std.builtin.ReduceOp, x: anytype, expected: anytype) !void { |
| 506 | const N = @typeInfo(@TypeOf(x)).Array.len; | 526 | const N = @typeInfo(@TypeOf(x)).Array.len; |
| ... | @@ -636,6 +656,7 @@ test "vector reduce operation" { | ... | @@ -636,6 +656,7 @@ test "vector reduce operation" { |
| 636 | } | 656 | } |
| 637 | | 657 | |
| 638 | test "mask parameter of @shuffle is comptime scope" { | 658 | test "mask parameter of @shuffle is comptime scope" { |
| | 659 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 639 | const __v4hi = std.meta.Vector(4, i16); | 660 | const __v4hi = std.meta.Vector(4, i16); |
| 640 | var v4_a = __v4hi{ 0, 0, 0, 0 }; | 661 | var v4_a = __v4hi{ 0, 0, 0, 0 }; |
| 641 | var v4_b = __v4hi{ 0, 0, 0, 0 }; | 662 | var v4_b = __v4hi{ 0, 0, 0, 0 }; |
| ... | @@ -649,6 +670,7 @@ test "mask parameter of @shuffle is comptime scope" { | ... | @@ -649,6 +670,7 @@ test "mask parameter of @shuffle is comptime scope" { |
| 649 | } | 670 | } |
| 650 | | 671 | |
| 651 | test "saturating add" { | 672 | test "saturating add" { |
| | 673 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 652 | const S = struct { | 674 | const S = struct { |
| 653 | fn doTheTest() !void { | 675 | fn doTheTest() !void { |
| 654 | const u8x3 = std.meta.Vector(3, u8); | 676 | const u8x3 = std.meta.Vector(3, u8); |
| ... | @@ -662,6 +684,7 @@ test "saturating add" { | ... | @@ -662,6 +684,7 @@ test "saturating add" { |
| 662 | } | 684 | } |
| 663 | | 685 | |
| 664 | test "saturating subtraction" { | 686 | test "saturating subtraction" { |
| | 687 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 665 | const S = struct { | 688 | const S = struct { |
| 666 | fn doTheTest() !void { | 689 | fn doTheTest() !void { |
| 667 | const u8x3 = std.meta.Vector(3, u8); | 690 | const u8x3 = std.meta.Vector(3, u8); |
| ... | @@ -673,6 +696,7 @@ test "saturating subtraction" { | ... | @@ -673,6 +696,7 @@ test "saturating subtraction" { |
| 673 | } | 696 | } |
| 674 | | 697 | |
| 675 | test "saturating multiplication" { | 698 | test "saturating multiplication" { |
| | 699 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 676 | // TODO: once #9660 has been solved, remove this line | 700 | // TODO: once #9660 has been solved, remove this line |
| 677 | if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest; | 701 | if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest; |
| 678 | | 702 | |
| ... | @@ -688,6 +712,7 @@ test "saturating multiplication" { | ... | @@ -688,6 +712,7 @@ test "saturating multiplication" { |
| 688 | } | 712 | } |
| 689 | | 713 | |
| 690 | test "saturating shift-left" { | 714 | test "saturating shift-left" { |
| | 715 | if (builtin.zig_backend != .stage1) return error.SkipZigTest; // TODO |
| 691 | const S = struct { | 716 | const S = struct { |
| 692 | fn doTheTest() !void { | 717 | fn doTheTest() !void { |
| 693 | const u8x3 = std.meta.Vector(3, u8); | 718 | const u8x3 = std.meta.Vector(3, u8); |