aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2010-02-04 01:53:37 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2010-02-04 01:53:37 +0000
commita6f4d51d82679c964930d64ccef496f52a640e35 (patch)
tree68eff35c2a0ade01544bb86ddba5dd185e21bf05
parente3e2cdd182e890304a87adde7a107ca2220b1e82 (diff)
downloadgcc-a6f4d51d82679c964930d64ccef496f52a640e35.zip
gcc-a6f4d51d82679c964930d64ccef496f52a640e35.tar.gz
gcc-a6f4d51d82679c964930d64ccef496f52a640e35.tar.bz2
re PR fortran/42901 (reading array of structures from namelist fails)
2010-02-03 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libfortran/42901 * gfortran.dg/namelist_60.f90: New test. From-SVN: r156488
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_60.f9027
2 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fd84e5e..0e84ff6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/42901
+ * gfortran.dg/namelist_60.f90: New test.
+
2010-02-03 Jason Merrill <jason@redhat.com>
PR c++/40138
diff --git a/gcc/testsuite/gfortran.dg/namelist_60.f90 b/gcc/testsuite/gfortran.dg/namelist_60.f90
new file mode 100644
index 0000000..5cab78b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_60.f90
@@ -0,0 +1,27 @@
+! { dg-do run }
+! PR42901 Reading array of structures from namelist
+! Test case derived from the reporters test case.
+program test_nml
+type field_descr
+ integer number
+end type
+type fsetup
+ type (field_descr), dimension(3) :: vel ! 3 velocity components
+end type
+type (fsetup) field_setup
+namelist /nl_setup/ field_setup
+field_setup%vel%number = 0
+! write(*,nml=nl_setup)
+open(10, status="scratch")
+write(10,'(a)') "&nl_setup"
+write(10,'(a)') " field_setup%vel(1)%number= 3,"
+write(10,'(a)') " field_setup%vel(2)%number= 9,"
+write(10,'(a)') " field_setup%vel(3)%number= 27,"
+write(10,'(a)') "/"
+rewind(10)
+read(10,nml=nl_setup)
+if (field_setup%vel(1)%number .ne. 3) call abort
+if (field_setup%vel(2)%number .ne. 9) call abort
+if (field_setup%vel(3)%number .ne. 27) call abort
+! write(*,nml=nl_setup)
+end program test_nml