{: test that arithmetic overflow causes a fatal error }

{$d+}
program d094( output );

var
   k : integer;

function side : integer;
begin
   side := k;
   k := k+1;
end;
begin {d094}

   k := 10;
   writeln( '10*10 is ', 10*side:1);
   if k <> 11 then
      writeln( 'multiply operator for debug has side effects' );

   k := maxint div 2;
   writeln( k:1, '*2 is ', 2*k );
   k := k+1;
   writeln( k:1, '*2 is ', 2*k ); { should overflow }
   writeln( 'fails: overflow in multiply operator error is not detected' );
end. { d094 }

