2016-01-15 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / iostat_1.f90
blob79bc0018fbda02042de8f905a9730127a643a6c8
1 ! { dg-do run }
2 ! PR 23598 - The iostat variable wasn't reset if the previous
3 ! I/O library call had an error.
4 program main
5 implicit none
6 integer :: ios, i
7 open (10, pad='no', status='scratch')
8 write (10, '(A)') '1','1'
9 rewind (10)
10 read (10,'(I2)',iostat=ios) i
11 ios = -4321
12 read (10, '(I1)', iostat=ios) i
13 if (ios /= 0) call abort
14 end program main