re PR fortran/55352 (Erroneous gfortran warning of unused module variable when variab...
[gcc.git] / gcc / testsuite / gfortran.dg / namelist_76.f90
1 ! { dg-do compile }
2 !
3 ! PR 55352: [4.7/4.8 Regression] Erroneous gfortran warning of unused module variable when variable is only used in namelist
4 !
5 ! Contributed by <AstroFloyd@gmail.com>
6
7 module data
8 implicit none
9 integer :: a
10 end module data
11
12 program test
13 use data, only: a
14 implicit none
15 a = 1
16 call write_data()
17 end program test
18
19 subroutine write_data()
20 use data, only: a
21 implicit none
22 namelist /write_data_list/ a
23 open(unit=10,form='formatted',status='replace',action='write',file='test.dat')
24 write(10, nml=write_data_list)
25 close(10)
26 end subroutine write_data
27
28 ! { dg-final { cleanup-modules "data" } }