aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTilo Schwarz <tilo@tilo-schwarz.de>2013-03-25 20:11:20 +0000
committerTilo Schwarz <tiloschwarz@gcc.gnu.org>2013-03-25 20:11:20 +0000
commit6f6fafc9eff46ac56d9279e86676693f28c088b0 (patch)
treebad93b9648ef2b28d85f31cf7a6dd10c53a76fe9 /gcc
parent39e45653572c760e4d12d08d859615a1da9b1d81 (diff)
downloadgcc-6f6fafc9eff46ac56d9279e86676693f28c088b0.zip
gcc-6f6fafc9eff46ac56d9279e86676693f28c088b0.tar.gz
gcc-6f6fafc9eff46ac56d9279e86676693f28c088b0.tar.bz2
re PR fortran/52512 (Cannot match namelist object name)
2013-03-25 Tilo Schwarz <tilo@tilo-schwarz.de> PR libfortran/52512 * io/list_read.c (nml_parse_qualifier): To check for a derived type don't use the namelist head element type but the current element type. (nml_get_obj_data): Add current namelist element type to nml_parse_qualifier call. 2013-03-25 Tilo Schwarz <tilo@tilo-schwarz.de> PR libfortran/52512 * gfortran.dg/namelist_79.f90: New. From-SVN: r197061
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_79.f9043
2 files changed, 48 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 36552cc..aa2274f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2013-03-25 Tilo Schwarz <tilo@tilo-schwarz.de>
+
+ PR libfortran/52512
+ * gfortran.dg/namelist_79.f90: New.
+
2013-03-25 Martin Jambor <mjambor@suse.cz>
* gcc.dg/ipa/ipcp-agg-9.c: New test.
diff --git a/gcc/testsuite/gfortran.dg/namelist_79.f90 b/gcc/testsuite/gfortran.dg/namelist_79.f90
new file mode 100644
index 0000000..2b2ef31
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_79.f90
@@ -0,0 +1,43 @@
+! { dg-do run }
+! PR libfortran/52512 - Cannot match namelist object name
+! Test case derived from PR.
+
+program testje
+
+ implicit none
+
+ integer :: getal, jn
+ type ptracer
+ character(len = 8) :: sname !: short name
+ logical :: lini !: read in a file or not
+ end type ptracer
+ type(ptracer) , dimension(3) :: tracer
+ namelist/namtoptrc/ getal,tracer
+
+ ! standard values
+ getal = 9999
+ do jn = 1, 3
+ tracer(jn)%sname = 'default_name'
+ tracer(jn)%lini = .false.
+ end do
+
+ open (10, status='scratch')
+ write (10, '(a)') "&namtoptrc"
+ write (10, '(a)') " getal = 7"
+ write (10, '(a)') " tracer(1) = 'DIC ', .true."
+ write (10, '(a)') " tracer(2) = 'Alkalini', .true."
+ write (10, '(a)') " tracer(3) = 'O2 ', .true."
+ write (10, '(a)') "/"
+ rewind(10)
+ read(10, nml=namtoptrc)
+ close (10)
+
+ if (getal /= 7) call abort
+ if (tracer(1)%sname /= 'DIC ') call abort
+ if (tracer(2)%sname /= 'Alkalini') call abort
+ if (tracer(3)%sname /= 'O2 ') call abort
+ if (.not. tracer(1)%lini) call abort
+ if (.not. tracer(2)%lini) call abort
+ if (.not. tracer(3)%lini) call abort
+
+end program testje