summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/list_read_4.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/list_read_4.f90
downloadcbb-gcc-4.6.4-upstream.tar.bz2
cbb-gcc-4.6.4-upstream.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/list_read_4.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/list_read_4.f9054
1 files changed, 54 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/list_read_4.f90 b/gcc/testsuite/gfortran.dg/list_read_4.f90
new file mode 100644
index 000000000..fb1770e23
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/list_read_4.f90
@@ -0,0 +1,54 @@
+! { dg-do run }
+! Test of gfortran list directed read> check delimiters are correctly
+! treated. Written in f77 so that g77 will run for comparison.
+!
+! f , e and i edit reads are terminated separately by read_real.c
+!
+! PThomas Jan 2005
+! BDavis
+ program list_read_4
+ integer i(10),l(10),k,j
+ real x(10),y(10)
+! expected results
+ data y / 1.0,2.0,3.0,-1.0,-1.0,-1.0,4.0,4.0,99.0,99.0 /
+ data l /1,2,3,-1,-1,-1,4,4,99,99/
+! put them in a file
+ open (10,status="scratch")
+ write (10,*) " 1.0, 2.0 , 3.0,, 2* , 2*4.0 , 5*99.0"
+ write (10,*) " 1.0e0, 2.0e0 , 3.0e0,, 2* , 2*4.0e0 , 5*99.0e0"
+ write (10,*) " 1, 2 , 3,, 2* , 2*4 , 5*99"
+ write (10,*) " 1, 2 , 3,, 2* , 2*4 , 5*99"
+ rewind (10)
+!
+ do k = 1,10
+ x(k) = -1.0
+ enddo
+ read (10,*,iostat=ier) x
+ if (ier.ne.0) call abort
+ do k = 1,10
+ if (x(k).ne.y(k)) call abort
+ x(k) = -1
+ end do
+ READ(10,*,iostat=ier) x
+ if (ier.ne.0) call abort
+ do k = 1,10
+ if (x(k).ne.y(k)) call abort
+ x(k) = -1
+ end do
+ READ(10,*,iostat=ier) x
+ if (ier.ne.0) call abort
+ do k = 1,10
+ if (x(k).ne.y(k)) call abort
+ x(k) = -1
+ end do
+! integer
+ do k = 1,10
+ i(k) = -1
+ end do
+ READ(10,*,iostat=ier) (i(j),j=1,10)
+ if (ier.ne.0) call abort
+ do k = 1,10
+ if (i(k).ne.y(k)) call abort
+ i(k) = -1
+ end do
+ end