view gcc/testsuite/gfortran.dg/data_namelist_conflict.f90 @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
line wrap: on
line source

! { dg-do run }
! Problem report: http://gcc.gnu.org/ml/fortran/2010-05/msg00139.html
!
module globals
   implicit none
   integer j
   data j/1/
end module

program test
   use globals
   implicit none
   character(len=80) str
   integer :: i
   data i/0/
   namelist /nl/i,j
   open(unit=10,status='scratch')
   write(10,nl)
   i = 42
   j = 42
   rewind(10)
   read(10,nl)
   if (i /= 0 .or. j /= 1) STOP 1
   close(10)
end program