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

This commit is contained in:
Pierre Muller 2024-12-03 12:45:53 +00:00
parent 564d50ce8e
commit 3a481d9590

View File

@ -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.