aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/iostat_5.f90
blob: 1e72dfdf7e13a5400e778790c08c4c43f0e8c9fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
! PR libfortran/101255
! { dg-do run }

program test
  use ISO_FORTRAN_ENV, only: IOSTAT_EOR, IOSTAT_END
  implicit none
  character(len=50) :: err
  integer :: i

  err = ""
  flush(99, iostat=i, iomsg=err)

  if (err == "") stop 1
  if (i >= 0) stop 2
  if (i == IOSTAT_EOR .or. i == IOSTAT_END) stop 3
end