summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/namelist_11.f
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_11.f
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_11.f')
-rw-r--r--gcc/testsuite/gfortran.dg/namelist_11.f55
1 files changed, 55 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/namelist_11.f b/gcc/testsuite/gfortran.dg/namelist_11.f
new file mode 100644
index 000000000..672ee261c
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/namelist_11.f
@@ -0,0 +1,55 @@
+c { dg-do run { target fd_truncate } }
+c This program tests: namelist comment, a blank line before the nameilist name, the namelist name,
+c a scalar qualifier, various combinations of space, comma and lf delimiters, f-formats, e-formats
+c a blank line within the data read, nulls, a range qualifier, a new object name before end of data
+c and an integer read. It also tests that namelist output can be re-read by namelist input.
+c provided by Paul Thomas - pault@gcc.gnu.org
+
+ program namelist_1
+
+ REAL x(10)
+ REAL(kind=8) xx
+ integer ier
+ namelist /mynml/ x, xx
+
+ do i = 1 , 10
+ x(i) = -1
+ end do
+ x(6) = 6.0
+ x(10) = 10.0
+ xx = 0d0
+
+ open (10,status="scratch")
+ write (10, *) "!mynml"
+ write (10, *) ""
+ write (10, *) "&gf /"
+ write (10, *) "&mynml x(7) =+99.0e0 x=1.0, 2.0 ,"
+ write (10, *) " 2*3.0, ,, 7.0e0,+0.08e+02 !comment"
+ write (10, *) ""
+ write (10, *) " 9000e-3 x(4:5)=4 ,5 "
+ write (10, *) " x=,,3.0, xx=10d0 /"
+ rewind (10)
+
+ read (10, nml=mynml, IOSTAT=ier)
+ if (ier.ne.0) call abort
+ rewind (10)
+
+ do i = 1 , 10
+ if ( abs( x(i) - real(i) ) .gt. 1e-8 ) call abort
+ end do
+ if ( abs( xx - 10d0 ) .gt. 1e-8 ) call abort
+
+ write (10, nml=mynml, iostat=ier)
+ if (ier.ne.0) call abort
+ rewind (10)
+
+ read (10, NML=mynml, IOSTAT=ier)
+ if (ier.ne.0) call abort
+ close (10)
+
+ do i = 1 , 10
+ if ( abs( x(i) - real(i) ) .gt. 1e-8 ) call abort
+ end do
+ if ( abs( xx - 10d0 ) .gt. 1e-8 ) call abort
+
+ end program