authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-12-11 19:02:25+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-12-16 06:23:11+01:00
log647866dd63fc180c19b92b08b5a6a056bcc988e9
treeced45194b38aa0800c6abdbc6801f51c384bef03
parent423d1172513136d53fdd18c1e5add110631019ed
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

std.math: disable hypot tests on non-Debug powerpc64

https://github.com/llvm/llvm-project/issues/171869

1 files changed, 5 insertions(+), 0 deletions(-)

lib/std/math/hypot.zig+5
......@@ -1,3 +1,4 @@
1const builtin = @import("builtin");
12const std = @import("../std.zig");
23const math = std.math;
34const expect = std.testing.expect;
......@@ -92,10 +93,12 @@ const hypot_test_cases = .{
9293};
9394
9495test hypot {
96 if (builtin.cpu.arch.isPowerPC() and builtin.mode != .Debug) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/171869
9597 try expect(hypot(0.3, 0.4) == 0.5);
9698}
9799
98100test "hypot.correct" {
101 if (builtin.cpu.arch.isPowerPC() and builtin.mode != .Debug) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/171869
99102 inline for (.{ f16, f32, f64, f128 }) |T| {
100103 inline for (hypot_test_cases) |v| {
101104 const a: T, const b: T, const c: T = v;
......@@ -105,6 +108,7 @@ test "hypot.correct" {
105108}
106109
107110test "hypot.precise" {
111 if (builtin.cpu.arch.isPowerPC() and builtin.mode != .Debug) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/171869
108112 inline for (.{ f16, f32, f64 }) |T| { // f128 seems to be 5 ulp
109113 inline for (hypot_test_cases) |v| {
110114 const a: T, const b: T, const c: T = v;
......@@ -114,6 +118,7 @@ test "hypot.precise" {
114118}
115119
116120test "hypot.special" {
121 if (builtin.cpu.arch.isPowerPC() and builtin.mode != .Debug) return error.SkipZigTest; // https://github.com/llvm/llvm-project/issues/171869
117122 @setEvalBranchQuota(2000);
118123 inline for (.{ f16, f32, f64, f128 }) |T| {
119124 try expect(math.isNan(hypot(nan(T), 0.0)));