PR target/83368
[official-gcc.git] / gcc / testsuite / gfortran.dg / namelist_51.f90
blob9663bd68d9fc3b98b27bef273e0fee7b42c399b1
1 ! { dg-do run }
2 ! PR36676 Namelist comment problems
3 ! test case from PR, reduced by Jerry DeLisle <jvdelisle@gcc.gnu.org>
4 program mem_nml
5 implicit none
6 integer, save :: nxc
7 nxc = 0
8 call readNamelist()
9 contains
10 subroutine readNamelist()
11 implicit none
12 namelist /INPUT/ nxc
13 open(unit = 101, status="scratch")
14 write(101,'(a)')"&INPUT"
15 write(101,'(a)')""
16 write(101,'(a)')"!"
17 write(101,'(a)')"!"
18 write(101,'(a)')"!"
19 write(101,'(a)')"nxc = 100"
20 write(101,'(a)')"&END"
21 rewind(101)
22 read(unit = 101, nml = INPUT)
23 if (nxc /= 100) call abort
24 close(unit = 101)
25 endsubroutine
26 end program mem_nml