2005-01-22 Thomas Koenig <Thomas.Koenig@online.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / open_readonly_1.f90
blob622a07d2aeeafeb039a35cad330f11590a0626d1
1 ! { dg-do run }
2 ! PR19451
3 ! Writing to a non-empty readonly file caused a segfault.
4 ! We were still trying to write the EOR after an error ocurred
5 program prog
6 open (unit=10, file='PR19451.dat')
7 write (10,*) "Hello World"
8 close (10)
9 open (unit=10, file='PR19451.dat', action="read")
10 write (10,*,err=20) "Hello World"
11 call abort()
12 20 continue
13 end program