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

{$d+}
program d081( output );

var
   k : integer;

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

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

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

