Merge from mainline.
[official-gcc.git] / gcc / testsuite / gfortran.dg / empty_format_1.f90
blob79a2d0c17d745bf6f208e48f1d2543d233512b0d
1 ! { dg-do run }
2 ! PR 17709
3 ! We weren't resetting the internal EOR flag correctly, so the second read
4 ! wasn't advancing to the next line.
5 program main
6 integer io_unit
7 character*20 str
8 io_unit = 10
9 open (unit=io_unit,status='scratch',form='formatted')
10 write (io_unit, '(A)') "Line1"
11 write (io_unit, '(A)') "Line2"
12 write (io_unit, '(A)') "Line3"
13 rewind (io_unit)
14 read (io_unit,'(A)') str
15 if (str .ne. "Line1") call abort
16 read (io_unit,'()')
17 read (io_unit,'(A)') str
18 if (str .ne. "Line3") call abort
19 close(unit=io_unit)
20 end