summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-21 01:56:04 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-21 01:56:04 +0000
commitbd8c070e3b70d4db78452c43ab89d893654ff9f4 (patch)
tree06d640962953017db240b1b3a130e56c1008951f
parentec81371e44cd12813767ffe74e9e48e393426491 (diff)
downloadgcc-bd8c070e3b70d4db78452c43ab89d893654ff9f4.tar.gz
2006-05-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/24459 * gfortran.dg/namelist_24.f90: New test. * gfortran.dg/namelist_12.f: Fix typo in comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113948 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_12.f2
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_24.f9042
3 files changed, 49 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d558ee28521..ea6e5a54f74 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2006-05-20 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/24459
+ * gfortran.dg/namelist_24.f90: New test.
+ * gfortran.dg/namelist_12.f: Fix typo in comment.
+
2006-05-20 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/25776
diff --git a/gcc/testsuite/gfortran.dg/namelist_12.f b/gcc/testsuite/gfortran.dg/namelist_12.f
index dba32acfb66..69fe3d8ac43 100644
--- a/gcc/testsuite/gfortran.dg/namelist_12.f
+++ b/gcc/testsuite/gfortran.dg/namelist_12.f
@@ -1,7 +1,7 @@
c{ dg-do run }
c This program repeats many of the same tests as test_nml_1 but for integer
c instead of real. It also tests repeat nulls, comma delimited character read,
-c a triplet qualifier, a range with and assumed start, a quote delimited string,
+c a triplet qualifier, a range with an assumed start, a quote delimited string,
c a qualifier with an assumed end and a fully explicit range. It also tests
c that integers and characters are successfully read back by namelist.
c Provided by Paul Thomas - pault@gcc.gnu.org
diff --git a/gcc/testsuite/gfortran.dg/namelist_24.f90 b/gcc/testsuite/gfortran.dg/namelist_24.f90
new file mode 100644
index 00000000000..4e60269c1da
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_24.f90
@@ -0,0 +1,42 @@
+!{ dg-do run }
+!{ dg-options -std=gnu }
+! Tests namelist read when more data is provided then specified by
+! array qualifier in list.
+! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>.
+ program pr24459
+ implicit none
+ integer nd, ier, i, j
+ parameter ( nd = 5 )
+ character*(8) names(nd,nd)
+ character*(8) names2(nd,nd)
+ character*(8) names3(nd,nd)
+ namelist / mynml / names, names2, names3
+ open(unit=20,status='scratch')
+ write (20, '(a)') "&MYNML"
+ write (20, '(a)') "NAMES = 25*'0'"
+ write (20, '(a)') "NAMES2 = 25*'0'"
+ write (20, '(a)') "NAMES3 = 25*'0'"
+ write (20, '(a)') "NAMES(2,2) = 'frogger'"
+ write (20, '(a)') "NAMES(1,1) = 'E123' 'E456' 'D789' 'P135' 'P246'"
+ write (20, '(a)') "NAMES2(1:5:2,2) = 'abcde' 'fghij' 'klmno'"
+ write (20, '(a)') "NAMES3 = 'E123' 'E456' 'D789' 'P135' 'P246' '0' 'frogger'"
+ write (20, '(a)') "/"
+ rewind(20)
+ read(20,nml=mynml, iostat=ier)
+ if (ier.ne.0) call abort()
+ if (any(names(:,3:5).ne."0")) call abort()
+ if (names(2,2).ne."frogger") call abort()
+ if (names(1,1).ne."E123") call abort()
+ if (names(2,1).ne."E456") call abort()
+ if (names(3,1).ne."D789") call abort()
+ if (names(4,1).ne."P135") call abort()
+ if (names(5,1).ne."P246") call abort()
+ if (any(names2(:,1).ne."0")) call abort()
+ if (any(names2(:,3:5).ne."0")) call abort()
+ if (names2(1,2).ne."abcde") call abort()
+ if (names2(2,2).ne."0") call abort()
+ if (names2(3,2).ne."fghij") call abort()
+ if (names2(4,2).ne."0") call abort()
+ if (names2(5,2).ne."klmno") call abort()
+ if (any(names3.ne.names)) call abort()
+ end