aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/namelist_54.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/namelist_54.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_54.f9015
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/namelist_54.f90 b/gcc/testsuite/gfortran.dg/namelist_54.f90
new file mode 100644
index 00000000000..25061c48fc5
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_54.f90
@@ -0,0 +1,15 @@
+! { dg-do run }
+! PR37707 Namelist read of array of derived type incorrect.
+type s
+ integer m
+ integer n
+end type s
+type(s) :: a(3)
+character*80 :: l = ' &namlis a%m=1,2, a%n=5,6, /'
+namelist /namlis/ a
+a%m=[87,88,89]
+a%n=[97,98,99]
+read(l,namlis)
+if (a(1)%m /= 1 .or. a(2)%m /= 2 .or. a(1)%n /= 5 .or. a(2)%n /= 6 .or. &
+ & a(3)%m /= 89 .or. a(3)%n /= 99) call abort
+end