2008-07-06 Kai Tietz <kai.tietz@onevision.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / empty_format_1.f90
blobe49ea4a5aee1003eaaa2e63dc2da2ec9eed3e393
1 ! { dg-do run { target fd_truncate } }
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