From 91bcdbec34ae5f56293e7470fe66924d161cd5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Mon, 18 May 2026 21:17:52 +0200 Subject: [PATCH 1/4] behavior: re-enable `vector reduce operation` on sparc64 closes https://github.com/ziglang/zig/issues/23719 --- test/behavior/vector.zig | 1 - 1 file changed, 1 deletion(-) diff --git a/test/behavior/vector.zig b/test/behavior/vector.zig index f20d083dea..c75d0e66e8 100644 --- a/test/behavior/vector.zig +++ b/test/behavior/vector.zig @@ -749,7 +749,6 @@ test "vector reduce operation" { if (builtin.zig_backend == .stage2_spirv) return error.SkipZigTest; if (builtin.zig_backend == .stage2_c and builtin.cpu.arch.isArm()) return error.SkipZigTest; if (builtin.zig_backend == .stage2_riscv64) return error.SkipZigTest; - if (builtin.zig_backend == .stage2_llvm and builtin.cpu.arch.isSPARC()) return error.SkipZigTest; // https://github.com/ziglang/zig/issues/23719 const S = struct { fn testReduce(comptime op: std.builtin.ReduceOp, x: anytype, expected: anytype) !void { From 3b41518c14cc2d9d9951a5ce3f44ed942502e1a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Mon, 18 May 2026 21:20:28 +0200 Subject: [PATCH 2/4] std: disable some tests that fail on sparc64 --- lib/std/Io/test.zig | 1 + lib/std/math/acos.zig | 2 ++ lib/std/math/asin.zig | 2 ++ 3 files changed, 5 insertions(+) diff --git a/lib/std/Io/test.zig b/lib/std/Io/test.zig index 46376a1825..54d79fceec 100644 --- a/lib/std/Io/test.zig +++ b/lib/std/Io/test.zig @@ -628,6 +628,7 @@ test "randomSecure" { test "memory mapping" { if (builtin.cpu.arch == .hexagon) return error.SkipZigTest; // mmap returned EINVAL + if (builtin.cpu.arch.isSPARC()) return error.SkipZigTest; // mmap returned EINVAL if (builtin.os.tag == .wasi and builtin.link_libc) { // https://github.com/ziglang/zig/issues/20747 (open fd does not have write permission) return error.SkipZigTest; diff --git a/lib/std/math/acos.zig b/lib/std/math/acos.zig index 21b1f1b889..285190227c 100644 --- a/lib/std/math/acos.zig +++ b/lib/std/math/acos.zig @@ -448,6 +448,8 @@ test "acosBinary128.special" { } test "acosBinary128" { + if (builtin.cpu.arch.isSPARC()) return error.SkipZigTest; + try testing.expectApproxEqAbs(0x1.250e9a58f049eeafa99db4360c88p1, acosBinary128(-0x1.511bdb99a3c4373bedf834ef4f68p-1), math.floatEpsAt(f128, 0x1.250e9a58f049eeafa99db4360c88p1)); try testing.expectApproxEqAbs(0x1.2786664b1c676c99437b68590004p1, acosBinary128(-0x1.5879cc3ad6dfd2a52e9891c69808p-1), math.floatEpsAt(f128, 0x1.2786664b1c676c99437b68590004p1)); try testing.expectApproxEqAbs(0x1.cb190cd361c7c03a09c470b4caebp-1, acosBinary128(0x1.3f988ba64a7eb97a751c5f0b3077p-1), math.floatEpsAt(f128, 0x1.cb190cd361c7c03a09c470b4caebp-1)); diff --git a/lib/std/math/asin.zig b/lib/std/math/asin.zig index 1248e72459..68efd182aa 100644 --- a/lib/std/math/asin.zig +++ b/lib/std/math/asin.zig @@ -442,6 +442,8 @@ test "asinBinary128.special" { } test "asinBinary128" { + if (builtin.cpu.arch.isSPARC()) return error.SkipZigTest; + try testing.expectApproxEqAbs(0x1.87e9c740d7837f8e8fa667988fbep-3, asinBinary128(0x1.85868ce287ca0196b01c25fec5ffp-3), math.floatEpsAt(f128, 0x1.87e9c740d7837f8e8fa667988fbep-3)); try testing.expectApproxEqAbs(0x1.bd11a474e864213b48e0f005f1f4p-1, asinBinary128(0x1.8718d6d30b4daed08d04ef59f478p-1), math.floatEpsAt(f128, 0x1.bd11a474e864213b48e0f005f1f4p-1)); try testing.expectApproxEqAbs(0x1.20b56f8b42649fe72d1f8d68a378p-1, asinBinary128(0x1.11a67640cd7f0ba5d5e362f3abfap-1), math.floatEpsAt(f128, 0x1.20b56f8b42649fe72d1f8d68a378p-1)); From 3b330f1d7c36416924f8986a6c541331130297d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Mon, 18 May 2026 21:54:07 +0200 Subject: [PATCH 3/4] std: disable some failing cancelation tests on sparc64-linux https://codeberg.org/ziglang/zig/issues/35347 --- lib/std/Io/Threaded/test.zig | 2 ++ lib/std/Io/net/test.zig | 2 ++ lib/std/Io/test.zig | 2 ++ 3 files changed, 6 insertions(+) diff --git a/lib/std/Io/Threaded/test.zig b/lib/std/Io/Threaded/test.zig index 392323de9b..bb49dbc1b5 100644 --- a/lib/std/Io/Threaded/test.zig +++ b/lib/std/Io/Threaded/test.zig @@ -149,6 +149,8 @@ test "async with array return type" { } test "cancel blocked read from pipe" { + if (builtin.cpu.arch.isSPARC() and builtin.os.tag == .linux) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/35347 + const global = struct { fn readFromPipe(io: Io, pipe: Io.File) !void { var buf: [1]u8 = undefined; diff --git a/lib/std/Io/net/test.zig b/lib/std/Io/net/test.zig index 66798c520f..a93726c3c5 100644 --- a/lib/std/Io/net/test.zig +++ b/lib/std/Io/net/test.zig @@ -350,6 +350,8 @@ test "decompress compressed DNS name" { } test "cancel accept" { + if (builtin.cpu.arch.isSPARC() and builtin.os.tag == .linux) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/35347 + const io = testing.io; const localhost: net.IpAddress = .{ .ip4 = .loopback(0) }; diff --git a/lib/std/Io/test.zig b/lib/std/Io/test.zig index 54d79fceec..3386a5475c 100644 --- a/lib/std/Io/test.zig +++ b/lib/std/Io/test.zig @@ -324,6 +324,8 @@ test "Group materializes error.Cancel" { } test "Group task receives cancelation unknowingly" { + if (builtin.cpu.arch.isSPARC() and builtin.os.tag == .linux) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/35347 + const S = struct { io: Io, err: ?Io.Cancelable!void, From f3d51edbef7570c4e4867846584a5321420472dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Mon, 18 May 2026 21:18:14 +0200 Subject: [PATCH 4/4] test: add sparc64-linux-none to module test matrix --- test/tests.zig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/tests.zig b/test/tests.zig index 2922b8c899..ce65c75c63 100644 --- a/test/tests.zig +++ b/test/tests.zig @@ -995,6 +995,23 @@ const module_test_targets = blk: { .link_libc = true, }, + .{ + .target = .{ + .cpu_arch = .sparc64, + .os_tag = .linux, + .abi = .none, + }, + }, + // SPARC linking support is currently incomplete. + // .{ + // .target = .{ + // .cpu_arch = .sparc64, + // .os_tag = .linux, + // .abi = .gnu, + // }, + // .link_libc = true, + // }, + // Calls are normally lowered to branch instructions that only support +/- 16 MB range when // targeting Thumb. This easily becomes insufficient for our test binaries, so use long // calls to avoid out-of-range relocations.