authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-04-25 12:57:25+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-04-25 21:54:48+02:00
logbd12a5a6e146a257ad98f5fabde18c312560ec38
treed683a2cf27dee7a96a8dcdc0213fabf5a6b7ab88
parent1af476d5d8568dac9d62983e3b619877a8fa22ac
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std: re-enable a bunch of tests that now pass

closes https://github.com/ziglang/zig/issues/21893 closes https://github.com/ziglang/zig/issues/23806 closes https://github.com/ziglang/zig/issues/23807 closes https://github.com/ziglang/zig/issues/24191 closes https://codeberg.org/ziglang/zig/issues/30220

6 files changed, 5 insertions(+), 35 deletions(-)

lib/std/Io/test.zig-1
...@@ -137,7 +137,6 @@ test "File.setLength" {...@@ -137,7 +137,6 @@ test "File.setLength" {
137test "legacy setLength" {137test "legacy setLength" {
138 // https://github.com/ziglang/zig/issues/20747 (open fd does not have write permission)138 // https://github.com/ziglang/zig/issues/20747 (open fd does not have write permission)
139 if (builtin.os.tag == .wasi and builtin.link_libc) return error.SkipZigTest;139 if (builtin.os.tag == .wasi and builtin.link_libc) return error.SkipZigTest;
140 if (builtin.cpu.arch.isMIPS64() and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23806
141140
142 const io = testing.io;141 const io = testing.io;
143142
lib/std/hash/xxhash.zig-6
...@@ -780,8 +780,6 @@ fn testExpect(comptime H: type, seed: anytype, input: []const u8, expected: u64)...@@ -780,8 +780,6 @@ fn testExpect(comptime H: type, seed: anytype, input: []const u8, expected: u64)
780}780}
781781
782test "xxhash3" {782test "xxhash3" {
783 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807
784
785 const H = XxHash3;783 const H = XxHash3;
786 // Non-Seeded Tests784 // Non-Seeded Tests
787 try testExpect(H, 0, "", 0x2d06800538d394c2);785 try testExpect(H, 0, "", 0x2d06800538d394c2);
...@@ -813,8 +811,6 @@ test "xxhash3" {...@@ -813,8 +811,6 @@ test "xxhash3" {
813}811}
814812
815test "xxhash3 smhasher" {813test "xxhash3 smhasher" {
816 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807
817
818 const Test = struct {814 const Test = struct {
819 fn do() !void {815 fn do() !void {
820 try expectEqual(verify.smhasher(XxHash3.hash), 0x9a636405);816 try expectEqual(verify.smhasher(XxHash3.hash), 0x9a636405);
...@@ -826,8 +822,6 @@ test "xxhash3 smhasher" {...@@ -826,8 +822,6 @@ test "xxhash3 smhasher" {
826}822}
827823
828test "xxhash3 iterative api" {824test "xxhash3 iterative api" {
829 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807
830
831 const Test = struct {825 const Test = struct {
832 fn do() !void {826 fn do() !void {
833 try verify.iterativeApi(XxHash3);827 try verify.iterativeApi(XxHash3);
lib/std/math/big/int_test.zig+1-3
...@@ -484,7 +484,7 @@ fn toFloat(comptime Float: type) !void {...@@ -484,7 +484,7 @@ fn toFloat(comptime Float: type) !void {
484 );484 );
485}485}
486test toFloat {486test toFloat {
487 if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/24191487 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
488 try toFloat(f16);488 try toFloat(f16);
489 try toFloat(f32);489 try toFloat(f32);
490 try toFloat(f64);490 try toFloat(f64);
...@@ -2801,8 +2801,6 @@ test "bitNotWrap more than two limbs" {...@@ -2801,8 +2801,6 @@ test "bitNotWrap more than two limbs" {
2801 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO2801 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
2802 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO2802 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
2803 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO2803 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
2804 // LLVM: unexpected runtime library name: __umodei4
2805 if (builtin.zig_backend == .stage2_llvm and comptime builtin.target.cpu.arch.isWasm()) return error.SkipZigTest; // TODO
28062804
2807 var a = try Managed.initSet(testing.allocator, maxInt(Limb));2805 var a = try Managed.initSet(testing.allocator, maxInt(Limb));
2808 defer a.deinit();2806 defer a.deinit();
lib/std/math/log10.zig-2
...@@ -139,8 +139,6 @@ test log10_int {...@@ -139,8 +139,6 @@ test log10_int {
139 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO139 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
140 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO140 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
141 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO141 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
142 if (builtin.zig_backend == .stage2_llvm and comptime builtin.target.cpu.arch.isWasm()) return error.SkipZigTest; // TODO
143 if (builtin.zig_backend == .stage2_llvm and comptime builtin.target.cpu.arch == .hexagon) return error.SkipZigTest;
144142
145 inline for (143 inline for (
146 .{ u8, u16, u32, u64, u128, u256, u512 },144 .{ u8, u16, u32, u64, u128, u256, u512 },
lib/std/os/linux/test.zig-2
...@@ -10,8 +10,6 @@ const expectEqual = std.testing.expectEqual;...@@ -10,8 +10,6 @@ const expectEqual = std.testing.expectEqual;
10const fs = std.fs;10const fs = std.fs;
1111
12test "fallocate" {12test "fallocate" {
13 if (builtin.cpu.arch.isMIPS64() and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/30220
14
15 const io = std.testing.io;13 const io = std.testing.io;
1614
17 var tmp = std.testing.tmpDir(.{});15 var tmp = std.testing.tmpDir(.{});
lib/std/simd.zig+4-21
...@@ -157,13 +157,6 @@ pub fn join(a: anytype, b: anytype) @Vector(vectorLength(@TypeOf(a)) + vectorLen...@@ -157,13 +157,6 @@ pub fn join(a: anytype, b: anytype) @Vector(vectorLength(@TypeOf(a)) + vectorLen
157/// Returns a vector whose elements alternates between those of each input vector.157/// Returns a vector whose elements alternates between those of each input vector.
158/// For example, `interlace(.{[4]u32{11, 12, 13, 14}, [4]u32{21, 22, 23, 24}})` returns a vector containing `.{11, 21, 12, 22, 13, 23, 14, 24}`.158/// For example, `interlace(.{[4]u32{11, 12, 13, 14}, [4]u32{21, 22, 23, 24}})` returns a vector containing `.{11, 21, 12, 22, 13, 23, 14, 24}`.
159pub fn interlace(vecs: anytype) @Vector(vectorLength(@TypeOf(vecs[0])) * vecs.len, std.meta.Child(@TypeOf(vecs[0]))) {159pub fn interlace(vecs: anytype) @Vector(vectorLength(@TypeOf(vecs[0])) * vecs.len, std.meta.Child(@TypeOf(vecs[0]))) {
160 // interlace doesn't work on MIPS, for some reason.
161 // Notes from earlier debug attempt:
162 // The indices are correct. The problem seems to be with the @shuffle builtin.
163 // On MIPS, the test that interlaces small_base gives { 0, 2, 0, 0, 64, 255, 248, 200, 0, 0 }.
164 // Calling this with two inputs seems to work fine, but I'll let the compile error trigger for all inputs, just to be safe.
165 if (builtin.cpu.arch.isMIPS()) @compileError("TODO: Find out why interlace() doesn't work on MIPS");
166
167 const VecType = @TypeOf(vecs[0]);160 const VecType = @TypeOf(vecs[0]);
168 const vecs_arr = @as([vecs.len]VecType, vecs);161 const vecs_arr = @as([vecs.len]VecType, vecs);
169 const Child = std.meta.Child(@TypeOf(vecs_arr[0]));162 const Child = std.meta.Child(@TypeOf(vecs_arr[0]));
...@@ -247,13 +240,11 @@ test "vector patterns" {...@@ -247,13 +240,11 @@ test "vector patterns" {
247 try std.testing.expectEqual([8]u32{ 10, 20, 30, 40, 55, 66, 77, 88 }, join(base, other_base));240 try std.testing.expectEqual([8]u32{ 10, 20, 30, 40, 55, 66, 77, 88 }, join(base, other_base));
248 try std.testing.expectEqual([2]u32{ 20, 30 }, extract(base, 1, 2));241 try std.testing.expectEqual([2]u32{ 20, 30 }, extract(base, 1, 2));
249242
250 if (!builtin.cpu.arch.isMIPS()) {243 try std.testing.expectEqual([8]u32{ 10, 55, 20, 66, 30, 77, 40, 88 }, interlace(.{ base, other_base }));
251 try std.testing.expectEqual([8]u32{ 10, 55, 20, 66, 30, 77, 40, 88 }, interlace(.{ base, other_base }));
252244
253 const small_braid = interlace(small_bases);245 const small_braid = interlace(small_bases);
254 try std.testing.expectEqual([10]u8{ 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 }, small_braid);246 try std.testing.expectEqual([10]u8{ 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 }, small_braid);
255 try std.testing.expectEqual(small_bases, deinterlace(small_bases.len, small_braid));247 try std.testing.expectEqual(small_bases, deinterlace(small_bases.len, small_braid));
256 }
257}248}
258249
259/// Joins two vectors, shifts them leftwards (towards lower indices) and extracts the leftmost elements into a vector the length of a and b.250/// Joins two vectors, shifts them leftwards (towards lower indices) and extracts the leftmost elements into a vector the length of a and b.
...@@ -384,9 +375,6 @@ pub fn prefixScanWithFunc(...@@ -384,9 +375,6 @@ pub fn prefixScanWithFunc(
384 /// For example, this should be 0 for addition or 1 for multiplication.375 /// For example, this should be 0 for addition or 1 for multiplication.
385 comptime identity: std.meta.Child(@TypeOf(vec)),376 comptime identity: std.meta.Child(@TypeOf(vec)),
386) if (ErrorType == void) @TypeOf(vec) else ErrorType!@TypeOf(vec) {377) if (ErrorType == void) @TypeOf(vec) else ErrorType!@TypeOf(vec) {
387 // I haven't debugged this, but it might be a cousin of sorts to what's going on with interlace.
388 if (builtin.cpu.arch.isMIPS()) @compileError("TODO: Find out why prefixScan doesn't work on MIPS");
389
390 const len = vectorLength(@TypeOf(vec));378 const len = vectorLength(@TypeOf(vec));
391379
392 if (hop == 0) @compileError("hop can not be 0; you'd be going nowhere forever!");380 if (hop == 0) @compileError("hop can not be 0; you'd be going nowhere forever!");
...@@ -456,11 +444,6 @@ pub fn prefixScan(comptime op: std.builtin.ReduceOp, comptime hop: isize, vec: a...@@ -456,11 +444,6 @@ pub fn prefixScan(comptime op: std.builtin.ReduceOp, comptime hop: isize, vec: a
456}444}
457445
458test "vector prefix scan" {446test "vector prefix scan" {
459 if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21893
460 if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest;
461
462 if (builtin.cpu.arch.isMIPS()) return error.SkipZigTest;
463
464 const int_base = @Vector(4, i32){ 11, 23, 9, -21 };447 const int_base = @Vector(4, i32){ 11, 23, 9, -21 };
465 const float_base = @Vector(4, f32){ 2, 0.5, -10, 6.54321 };448 const float_base = @Vector(4, f32){ 2, 0.5, -10, 6.54321 };
466 const bool_base = @Vector(4, bool){ true, false, true, false };449 const bool_base = @Vector(4, bool){ true, false, true, false };