From bd12a5a6e146a257ad98f5fabde18c312560ec38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 25 Apr 2026 12:57:25 +0200 Subject: [PATCH] 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 --- lib/std/Io/test.zig | 1 - lib/std/hash/xxhash.zig | 6 ------ lib/std/math/big/int_test.zig | 4 +--- lib/std/math/log10.zig | 2 -- lib/std/os/linux/test.zig | 2 -- lib/std/simd.zig | 25 ++++--------------------- 6 files changed, 5 insertions(+), 35 deletions(-) diff --git a/lib/std/Io/test.zig b/lib/std/Io/test.zig index 20426acb9c..46376a1825 100644 --- a/lib/std/Io/test.zig +++ b/lib/std/Io/test.zig @@ -137,7 +137,6 @@ test "File.setLength" { test "legacy setLength" { // https://github.com/ziglang/zig/issues/20747 (open fd does not have write permission) if (builtin.os.tag == .wasi and builtin.link_libc) return error.SkipZigTest; - if (builtin.cpu.arch.isMIPS64() and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23806 const io = testing.io; diff --git a/lib/std/hash/xxhash.zig b/lib/std/hash/xxhash.zig index 270759802e..107b608006 100644 --- a/lib/std/hash/xxhash.zig +++ b/lib/std/hash/xxhash.zig @@ -780,8 +780,6 @@ fn testExpect(comptime H: type, seed: anytype, input: []const u8, expected: u64) } test "xxhash3" { - if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807 - const H = XxHash3; // Non-Seeded Tests try testExpect(H, 0, "", 0x2d06800538d394c2); @@ -813,8 +811,6 @@ test "xxhash3" { } test "xxhash3 smhasher" { - if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807 - const Test = struct { fn do() !void { try expectEqual(verify.smhasher(XxHash3.hash), 0x9a636405); @@ -826,8 +822,6 @@ test "xxhash3 smhasher" { } test "xxhash3 iterative api" { - if (builtin.cpu.arch.isMIPS64()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23807 - const Test = struct { fn do() !void { try verify.iterativeApi(XxHash3); diff --git a/lib/std/math/big/int_test.zig b/lib/std/math/big/int_test.zig index 661d8a3a32..4779d145a4 100644 --- a/lib/std/math/big/int_test.zig +++ b/lib/std/math/big/int_test.zig @@ -484,7 +484,7 @@ fn toFloat(comptime Float: type) !void { ); } test toFloat { - if (builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/24191 + if (builtin.cpu.arch == .x86) return error.SkipZigTest; try toFloat(f16); try toFloat(f32); try toFloat(f64); @@ -2801,8 +2801,6 @@ test "bitNotWrap more than two limbs" { if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO - // LLVM: unexpected runtime library name: __umodei4 - if (builtin.zig_backend == .stage2_llvm and comptime builtin.target.cpu.arch.isWasm()) return error.SkipZigTest; // TODO var a = try Managed.initSet(testing.allocator, maxInt(Limb)); defer a.deinit(); diff --git a/lib/std/math/log10.zig b/lib/std/math/log10.zig index 4c1bb412a0..8e5366a8e3 100644 --- a/lib/std/math/log10.zig +++ b/lib/std/math/log10.zig @@ -139,8 +139,6 @@ test log10_int { if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_llvm and comptime builtin.target.cpu.arch.isWasm()) return error.SkipZigTest; // TODO - if (builtin.zig_backend == .stage2_llvm and comptime builtin.target.cpu.arch == .hexagon) return error.SkipZigTest; inline for ( .{ u8, u16, u32, u64, u128, u256, u512 }, diff --git a/lib/std/os/linux/test.zig b/lib/std/os/linux/test.zig index 63e0d2f96a..043c04bf1f 100644 --- a/lib/std/os/linux/test.zig +++ b/lib/std/os/linux/test.zig @@ -10,8 +10,6 @@ const expectEqual = std.testing.expectEqual; const fs = std.fs; test "fallocate" { - if (builtin.cpu.arch.isMIPS64() and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/30220 - const io = std.testing.io; var tmp = std.testing.tmpDir(.{}); diff --git a/lib/std/simd.zig b/lib/std/simd.zig index ea29098f35..d2ff4032a9 100644 --- a/lib/std/simd.zig +++ b/lib/std/simd.zig @@ -157,13 +157,6 @@ pub fn join(a: anytype, b: anytype) @Vector(vectorLength(@TypeOf(a)) + vectorLen /// Returns a vector whose elements alternates between those of each input vector. /// 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}`. pub fn interlace(vecs: anytype) @Vector(vectorLength(@TypeOf(vecs[0])) * vecs.len, std.meta.Child(@TypeOf(vecs[0]))) { - // interlace doesn't work on MIPS, for some reason. - // Notes from earlier debug attempt: - // The indices are correct. The problem seems to be with the @shuffle builtin. - // On MIPS, the test that interlaces small_base gives { 0, 2, 0, 0, 64, 255, 248, 200, 0, 0 }. - // Calling this with two inputs seems to work fine, but I'll let the compile error trigger for all inputs, just to be safe. - if (builtin.cpu.arch.isMIPS()) @compileError("TODO: Find out why interlace() doesn't work on MIPS"); - const VecType = @TypeOf(vecs[0]); const vecs_arr = @as([vecs.len]VecType, vecs); const Child = std.meta.Child(@TypeOf(vecs_arr[0])); @@ -247,13 +240,11 @@ test "vector patterns" { try std.testing.expectEqual([8]u32{ 10, 20, 30, 40, 55, 66, 77, 88 }, join(base, other_base)); try std.testing.expectEqual([2]u32{ 20, 30 }, extract(base, 1, 2)); - if (!builtin.cpu.arch.isMIPS()) { - try std.testing.expectEqual([8]u32{ 10, 55, 20, 66, 30, 77, 40, 88 }, interlace(.{ base, other_base })); + try std.testing.expectEqual([8]u32{ 10, 55, 20, 66, 30, 77, 40, 88 }, interlace(.{ base, other_base })); - const small_braid = interlace(small_bases); - try std.testing.expectEqual([10]u8{ 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 }, small_braid); - try std.testing.expectEqual(small_bases, deinterlace(small_bases.len, small_braid)); - } + const small_braid = interlace(small_bases); + try std.testing.expectEqual([10]u8{ 0, 2, 4, 6, 8, 1, 3, 5, 7, 9 }, small_braid); + try std.testing.expectEqual(small_bases, deinterlace(small_bases.len, small_braid)); } /// 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( /// For example, this should be 0 for addition or 1 for multiplication. comptime identity: std.meta.Child(@TypeOf(vec)), ) if (ErrorType == void) @TypeOf(vec) else ErrorType!@TypeOf(vec) { - // I haven't debugged this, but it might be a cousin of sorts to what's going on with interlace. - if (builtin.cpu.arch.isMIPS()) @compileError("TODO: Find out why prefixScan doesn't work on MIPS"); - const len = vectorLength(@TypeOf(vec)); 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 } test "vector prefix scan" { - if (builtin.cpu.arch == .aarch64_be and builtin.zig_backend == .stage2_llvm) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/21893 - if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch == .hexagon) return error.SkipZigTest; - - if (builtin.cpu.arch.isMIPS()) return error.SkipZigTest; - const int_base = @Vector(4, i32){ 11, 23, 9, -21 }; const float_base = @Vector(4, f32){ 2, 0.5, -10, 6.54321 }; const bool_base = @Vector(4, bool){ true, false, true, false };