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