summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/namelist_24.f90
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/gfortran.dg/namelist_24.f90
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'gcc/testsuite/gfortran.dg/namelist_24.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_24.f9042
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/namelist_24.f90 b/gcc/testsuite/gfortran.dg/namelist_24.f90
new file mode 100644
index 000000000..11cd2d0a4
--- /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', delim='apostrophe')
+ 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