re PR fortran/56660 (Fails to read NAMELIST with certain form array syntax)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Mon, 1 Apr 2013 20:59:34 +0000 (20:59 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Mon, 1 Apr 2013 20:59:34 +0000 (20:59 +0000)
2013-04-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/56660
* gfortran.dg/namelist_82.f90:  New test.

From-SVN: r197322

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/namelist_82.f90 [new file with mode: 0644]

index c1fc14d4bb435bd716990b93850da4b0e77928af..53dc7b0844a7c83dbf0b01932324023c52ba04c9 100644 (file)
@@ -1,3 +1,8 @@
+2013-04-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/56660
+       * gfortran.dg/namelist_82.f90:  New test.
+       
 2013-04-01  Janus Weil  <janus@gcc.gnu.org>
 
        PR fortran/56500
diff --git a/gcc/testsuite/gfortran.dg/namelist_82.f90 b/gcc/testsuite/gfortran.dg/namelist_82.f90
new file mode 100644 (file)
index 0000000..399d59f
--- /dev/null
@@ -0,0 +1,33 @@
+! { dg-do run }
+! PR56660  Fails to read NAMELIST with certain form array syntax
+type ptracer
+   character(len = 2)  :: sname
+   logical             :: lini
+end type ptracer
+
+type(ptracer) , dimension(3) :: tracer
+namelist/naml1/  tracer
+
+tracer(:) = ptracer('XXX', .false.)
+
+open (99, file='nml.dat', status="replace")
+write(99,*) "&naml1"
+!write(99,*) "   tracer(2)   = 'bb' , .true."
+write(99,*) "   tracer(:)   = 'aa' , .true."
+write(99,*) "   tracer(2)   = 'bb' , .true."
+write(99,*) "/"
+rewind(99)
+
+read (99, nml=naml1)
+close (99, status="delete")
+
+if (tracer(1)%sname.ne.'aa') call abort()
+if (.not.tracer(1)%lini) call abort()
+if (tracer(2)%sname.ne.'bb') call abort()
+if (.not.tracer(2)%lini) call abort()
+if (tracer(3)%sname.ne.'XX') call abort()
+if (tracer(3)%lini) call abort()
+
+!write (*, nml=naml1)
+
+end