Browse Source

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

florian 7 months ago
parent
commit
14dbb7cb76
2 changed files with 9 additions and 0 deletions
  1. 4 0
      tests/test/minmax.inc
  2. 5 0
      tests/test/tminmax3.pp

+ 4 - 0
tests/test/minmax.inc

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

+ 5 - 0
tests/test/tminmax3.pp

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