zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 1e838eba7543db06b2e57919c94d740188a11bfb (tree)
parent c13713dd02ccd6ae21a508ec43bc1725199d2ec8
Author: Alex Rønne Petersen <alex@alexrp.com>
Date:   Wed,  2 Oct 2024 04:05:40 +0200

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

Diffstat:
Mlib/std/math/isnan.zig | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/std/math/isnan.zig b/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)));