{: test that divisor of zero in div operator causes a fatal error }

{$d+}
program e081( output );

var
   k : integer;

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

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

   writeln( '11 div 0 is ', 11 div 0:1 );
   writeln( 'fails: divisor of zero in div operator error is not detected' );
end. { e081 }

