coarray_41.f90: Add "-latomic" option if libatomic_available.
[official-gcc.git] / gcc / testsuite / gfortran.dg / eor_handling_5.f90
blobc116fb7bdeaf371da34a205096ce48101ddb94b6
1 ! { dg-do run }
2 ! PR 20661: Handle non-advancing I/O with iostat
3 ! Test case by Walt Brainerd, The Fortran Company
5 program fc002
6 character(len=1) :: c
7 integer :: k,k2
8 character(len=*), parameter :: f="(a)"
9 open(11,status="scratch", iostat=k)
10 if (k /= 0) call abort
11 write(11,f) "x"
12 rewind (11)
13 read(11, f, advance="no", iostat=k) c
14 if (k /= 0) call abort
15 read(11, f, advance="no", iostat=k) c
16 if (k >= 0) call abort
17 read(11, f, advance="no", iostat=k2) c
18 if (k2 >= 0 .or. k == k2) call abort
19 end program fc002