blob: 80d7c61016560f537c385dbf098a35c9932ebaa7 [file] [log] [blame]
! { dg-do run }
! PR119502, negative unit numbers are not allowed without using NEWUNIT
program foo
integer :: iun = -1
integer :: ios
open (iun, iostat=ios)
if (ios == 0) stop 1
write(iun,*, iostat=ios) "This is a test."
if (ios == 0) stop 2
close (iun, iostat=ios)
if (ios == 0) stop 3
end