
{: test that round(x) causes a fatal error if it overflows }

{$d+}
program d025( output );

var
   x :  real;
function side : real;
begin
   side := x;
   x := x+1;
end;
begin
   x := -(maxint+0.4);
   writeln( '-(maxint+0.4) is ', round(side):1 ); { this should not overflow }
   if abs(x - (-(maxint+0.4)+1)) > 0.5 then
      writeln( 'side effect error evaluating round' );
   x := -(maxint+0.5);
   writeln( '-(maxint+0.5) is ', round(x):1 ); { this should overflow }
end. { d025 }

