Commit 1e838eba75

Alex Rønne Petersen <alex@alexrp.com>
2024-10-02 04:05:40
std.math: Re-enable isSignalNan test on most targets.
This remains disabled on arm, aarch64, and powerpc, as well as for the C backend, as it still fails for these targets. See: https://github.com/ziglang/zig/issues/14366
1 parent c13713d
Changed files (1)
lib
std
lib/std/math/isnan.zig
@@ -32,7 +32,13 @@ test isSignalNan {
         // TODO: Signalling NaN values get converted to quiet NaN values in
         //       some cases where they shouldn't such that this can fail.
         //       See https://github.com/ziglang/zig/issues/14366
-        // try expect(isSignalNan(math.snan(T)));
+        if (!builtin.cpu.arch.isArmOrThumb() and
+            !builtin.cpu.arch.isAARCH64() and
+            !builtin.cpu.arch.isPowerPC() and
+            builtin.zig_backend != .stage2_c)
+        {
+            try expect(isSignalNan(math.snan(T)));
+        }
         try expect(!isSignalNan(math.nan(T)));
         try expect(!isSignalNan(@as(T, 1.0)));
         try expect(!isSignalNan(math.inf(T)));