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