summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr18122.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/pr18122.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/pr18122.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/pr18122.f9045
1 files changed, 45 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/pr18122.f90 b/gcc/testsuite/gfortran.dg/pr18122.f90
new file mode 100644
index 000000000..3907f0ae1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr18122.f90
@@ -0,0 +1,45 @@
+! { dg-do run }
+! test namelist with scalars and arrays.
+! Based on example provided by thomas.koenig@online.de
+
+program sechs_w
+ implicit none
+
+ integer, parameter :: dr=selected_real_kind(15)
+
+ integer, parameter :: nkmax=6
+ real (kind=dr) :: rb(nkmax)
+ integer :: z
+
+ real (kind=dr) :: dg
+ real (kind=dr) :: a
+ real (kind=dr) :: da
+ real (kind=dr) :: delta
+ real (kind=dr) :: s,t
+ integer :: nk
+ real (kind=dr) alpha0
+
+ real (kind=dr) :: phi, phi0, rad, rex, zk, z0, drdphi, dzdphi
+
+ namelist /schnecke/ z, dg, a, t, delta, s, nk, rb, alpha0
+
+ open (10,status="scratch")
+ write (10, *) "&SCHNECKE"
+ write (10, *) " z=1,"
+ write (10, *) " dg=58.4,"
+ write (10, *) " a=48.,"
+ write (10, *) " delta=0.4,"
+ write (10, *) " s=0.4,"
+ write (10, *) " nk=6,"
+ write (10, *) " rb=60, 0, 40,"
+ write (10, *) " alpha0=20.,"
+ write (10, *) "/"
+
+ rewind (10)
+ read (10,schnecke)
+ close (10)
+ if ((z /= 1) .or. (dg /= 58.4_dr) .or. (a /= 48.0_dr) .or. &
+ (delta /= 0.4_dr).or. (s /= 0.4_dr) .or. (nk /= 6) .or. &
+ (rb(1) /= 60._dr).or. (rb(2) /= 0.0_dr).or. (rb(3) /=40.0_dr).or. &
+ (alpha0 /= 20.0_dr)) call abort ()
+end program sechs_w