summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/open_new.f90
blob: 96edd93c3473a0b045a180cebc2e3516cd95618d (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 call unlink ("foo.dat")
end program main