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
This commit is contained in:
Alex Rønne Petersen 2024-10-02 04:05:40 +02:00
parent c13713dd02
commit 1e838eba75
No known key found for this signature in database

View File

@ -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)));