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" {
137137test "legacy setLength" {
138138 // https://github.com/ziglang/zig/issues/20747 (open fd does not have write permission)
139139 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
142141 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)
780780}
781781
782782test "xxhash3" {
783 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807
784
785783 const H = XxHash3;
786784 // Non-Seeded Tests
787785 try testExpect(H, 0, "", 0x2d06800538d394c2);
......@@ -813,8 +811,6 @@ test "xxhash3" {
813811}
814812
815813test "xxhash3 smhasher" {
816 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807
817
818814 const Test = struct {
819815 fn do() !void {
820816 try expectEqual(verify.smhasher(XxHash3.hash), 0x9a636405);
......@@ -826,8 +822,6 @@ test "xxhash3 smhasher" {
826822}
827823
828824test "xxhash3 iterative api" {
829 if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807
830
831825 const Test = struct {
832826 fn do() !void {
833827 try verify.iterativeApi(XxHash3);
lib/std/math/big/int_test.zig+1-3
......@@ -484,7 +484,7 @@ fn toFloat(comptime Float: type) !void {
484484 );
485485}
486486test toFloat {
487 if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/24191
487 if (builtin.cpu.arch == .x86) return error.SkipZigTest;
488488 try toFloat(f16);
489489 try toFloat(f32);
490490 try toFloat(f64);
......@@ -2801,8 +2801,6 @@ test "bitNotWrap more than two limbs" {
28012801 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
28022802 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
28032803 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
28072805 var a = try Managed.initSet(testing.allocator, maxInt(Limb));
28082806 defer a.deinit();
lib/std/math/log10.zig-2
......@@ -139,8 +139,6 @@ test log10_int {
139139 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
140140 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
141141 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
145143 inline for (
146144 .{ u8, u16, u32, u64, u128, u256, u512 },
lib/std/os/linux/test.zig-2
......@@ -10,8 +10,6 @@ const expectEqual = std.testing.expectEqual;
1010const fs = std.fs;
1111
1212test "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
1513 const io = std.testing.io;
1614
1715 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
157157/// Returns a vector whose elements alternates between those of each input vector.
158158/// 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}`.
159159pub 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
167160 const VecType = @TypeOf(vecs[0]);
168161 const vecs_arr = @as([vecs.len]VecType, vecs);
169162 const Child = std.meta.Child(@TypeOf(vecs_arr[0]));
......@@ -247,13 +240,11 @@ test "vector patterns" {
247240 try std.testing.expectEqual([8]u32{ 10, 20, 30, 40, 55, 66, 77, 88 }, join(base, other_base));
248241 try std.testing.expectEqual([2]u32{ 20, 30 }, extract(base, 1, 2));
249242
250 if (!builtin.cpu.arch.isMIPS()) {
251 try std.testing.expectEqual([8]u32{ 10, 55, 20, 66, 30, 77, 40, 88 }, interlace(.{ base, other_base }));
243 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);
254 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));
256 }
245 const small_braid = interlace(small_bases);
246 try std.testing.expectEqual([10]u8{ 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 }, small_braid);
247 try std.testing.expectEqual(small_bases, deinterlace(small_bases.len, small_braid));
257248}
258249
259250/// 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(
384375 /// For example, this should be 0 for addition or 1 for multiplication.
385376 comptime identity: std.meta.Child(@TypeOf(vec)),
386377) 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
390378 const len = vectorLength(@TypeOf(vec));
391379
392380 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
456444}
457445
458446test "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
464447 const int_base = @Vector(4, i32){ 11, 23, 9, -21 };
465448 const float_base = @Vector(4, f32){ 2, 0.5, -10, 6.54321 };
466449 const bool_base = @Vector(4, bool){ true, false, true, false };