OSDN Git Service

2005-01-11 Paul Thomas <pault@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / empty_format_1.f90
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
21