2014-07-12 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / namelist_82.f90
blob399d59fe66bc60778e8900387731296d37a1cdd2
1 ! { dg-do run }
2 ! PR56660 Fails to read NAMELIST with certain form array syntax
3 type ptracer
4 character(len = 2) :: sname
5 logical :: lini
6 end type ptracer
8 type(ptracer) , dimension(3) :: tracer
9 namelist/naml1/ tracer
11 tracer(:) = ptracer('XXX', .false.)
13 open (99, file='nml.dat', status="replace")
14 write(99,*) "&naml1"
15 !write(99,*) " tracer(2) = 'bb' , .true."
16 write(99,*) " tracer(:) = 'aa' , .true."
17 write(99,*) " tracer(2) = 'bb' , .true."
18 write(99,*) "/"
19 rewind(99)
21 read (99, nml=naml1)
22 close (99, status="delete")
24 if (tracer(1)%sname.ne.'aa') call abort()
25 if (.not.tracer(1)%lini) call abort()
26 if (tracer(2)%sname.ne.'bb') call abort()
27 if (.not.tracer(2)%lini) call abort()
28 if (tracer(3)%sname.ne.'XX') call abort()
29 if (tracer(3)%lini) call abort()
31 !write (*, nml=naml1)
33 end