aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr88169_1.f90
blob: 6ea4aba5e10ac24073bcce3d7ecc649ab39c847b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
! { 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" } }