Browse Source

Add explicit -CE option and check that mysqrt returns zero for negative arg

Pierre Muller 8 months ago
parent
commit
3a481d9590
1 changed files with 6 additions and 0 deletions
  1. 6 0
      tests/test/tfpu2.pp

+ 6 - 0
tests/test/tfpu2.pp

@@ -1,4 +1,5 @@
 { %skiptarget=go32v2 }
+{ %opt=-CE }
 
 {$ifdef fpc}{$mode objfpc}{$endif}
 program test_fpu_excpetions;
@@ -28,4 +29,9 @@ begin
   Writeln('                   = 0       if x <  0');
   Writeln(' 6.5+5.76*mysqrt(3.1) = ',x+y*mysqrt(z):0:6);
   Writeln(' 6.5+5.76*mysqrt(-3.1) = ',x+y*mysqrt(-z):0:6);
+  if (x+y*mysqrt(-z)<>x) then
+    begin
+      writeln('Error: mysqrt does not return zero for negative argument');
+      halt(1);
+    end;
 end.