{: test that reading from a file opened for writing causes a fatal error }

{$d+}
program d036( output );

var
   f : text;
   i : integer;
begin { d036 }
   rewrite( f ); { open for writing }
   read( f, i );
   writeln( 'fails: read from file opened for writing' );
end. { d036 }

