Update concepts branch to revision 131834
[official-gcc.git] / gcc / testsuite / gfortran.dg / iostat_1.f90
blob2517eb992356fa3f69e48c9bcdeba1ec70269211
1 ! { dg-do run { target fd_truncate } }
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