* test also with FASTMATH on and adapt for tests not supposed to work (they include the use of NaN)

This commit is contained in:
florian 2025-01-06 15:17:51 +01:00
parent 1ed23e5472
commit 14dbb7cb76
2 changed files with 9 additions and 0 deletions

View File

@ -146,6 +146,7 @@ procedure TestSingle;
TestFail(37);
if Max4(v1,v3)<>v3 then
TestFail(38);
{$ifndef USE_FASTMATH}
SetExceptionMask([exInvalidOp]);
vNaN:=NaN;
if not(IsNaN(Min1(v1,vNaN))) then
@ -181,6 +182,7 @@ procedure TestSingle;
if Max4(vNaN,v3)<>v3 then
TestFail(56);
SetExceptionMask([]);
{$endif USE_FASTMATH}
end;
procedure TestDouble;
@ -322,6 +324,7 @@ procedure TestDouble;
TestFail(137);
if Max4(v1,v3)<>v3 then
TestFail(138);
{$ifndef USE_FASTMATH}
SetExceptionMask([exInvalidOp]);
vNaN:=NaN;
if not(IsNaN(Min1(v1,vNaN))) then
@ -357,6 +360,7 @@ procedure TestDouble;
if Max4(vNaN,v3)<>v3 then
TestFail(156);
SetExceptionMask([]);
{$endif USE_FASTMATH}
end;

5
tests/test/tminmax3.pp Normal file
View File

@ -0,0 +1,5 @@
{ %opt=-O- -O3 -Oofastmath } { use fast math ... }
{$define USE_FASTMATH} { ... so skip NaN tests }
{$mode objfpc}
{$I minmax.inc }