aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/open_new.f90
blob: 3b8e95ae9440c1cacddbf7a0623a62d62d8e95a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
! { dg-do run }
! PR 18982:  verifies that opening an existing file with
!            status="new" is an error
program main
  nout = 10
  open(nout, file="foo.dat", status="replace")     ! make sure foo.dat exists
  close(nout)
  open(nout, file="foo.dat", status="new",err=100)
  call abort                 ! This should never happen
100 continue
end program main