aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/namelist_76.f90
blob: acb3b2f656130e218963514130149ebd57541b02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
! { dg-do compile }
!
! PR 55352: [4.7/4.8 Regression] Erroneous gfortran warning of unused module variable when variable is only used in namelist
!
! Contributed by <AstroFloyd@gmail.com>

module data
  implicit none
  integer :: a
end module data

program test
  use data, only: a
  implicit none
  a = 1
  call write_data()
end program test

subroutine write_data()
  use data, only: a
  implicit none
  namelist /write_data_list/ a
  open(unit=10,form='formatted',status='replace',action='write',file='test.dat')
  write(10, nml=write_data_list)
  close(10)
end subroutine write_data

! { dg-final { cleanup-modules "data" } }