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

{$d+}
program d024( output );

var
   x :  real;

function side : real;
begin
   side := x;
   x := x+1;
end;
begin { d024 }
   x := maxint+0.4;
   writeln( 'maxint 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.4;
   writeln( 'maxint+0.5 is ', round(x+0.5):1 ); { this should overflow }
end. { d024 }

