blob: 6ea4aba5e10ac24073bcce3d7ecc649ab39c847b [file] [log] [blame]
! { dg-do run }
module foo_nml
implicit none
real :: x = -1
namelist /foo/ x
end module
program main
use foo_nml, only: bar => foo, x
implicit none
integer fd
x = 42
open(newunit=fd, file='tmp.dat', status='replace')
write(fd,nml=bar)
close(fd)
open(newunit=fd, file='tmp.dat', status='old')
read(fd,nml=bar)
if (x /= 42) stop 1
close(fd)
end program
! { dg-final { cleanup-modules "foo_nml" } }