From c4c12403f9be24d9e21a8503f6e6a4c9f1735766 Mon Sep 17 00:00:00 2001 From: jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Fri, 15 Sep 2006 13:32:12 +0000 Subject: [PATCH] 2006-09-15 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/29053 * gfortran.dg/streamio_9.f90: New test. * gfortran.dg/streamio_10.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116971 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/testsuite/ChangeLog | 6 ++++ gcc/testsuite/gfortran.dg/streamio_10.f90 | 37 +++++++++++++++++++++++ gcc/testsuite/gfortran.dg/streamio_9.f90 | 31 +++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/streamio_10.f90 create mode 100644 gcc/testsuite/gfortran.dg/streamio_9.f90 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fd06af6d7589..cc431da2d7e6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2006-09-15 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libgfortran/29053 + * gfortran.dg/streamio_9.f90: New test. + * gfortran.dg/streamio_10.f90: New test. + 2006-09-14 Andrew Pinski <pinskia@physics.uc.edu> PR C++/29002 diff --git a/gcc/testsuite/gfortran.dg/streamio_10.f90 b/gcc/testsuite/gfortran.dg/streamio_10.f90 new file mode 100644 index 000000000000..e49617e29319 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/streamio_10.f90 @@ -0,0 +1,37 @@ +! { dg-do run } +! PR25093 Stream IO test 10 +! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>. +! Test case derived from that given in PR by Steve Kargl. +program stream_io_10 + implicit none + integer :: a(4), b(4) + integer(kind=8) :: thepos + a = (/ 1, 2, 3, 4 /) + b = a + open(10, file="teststream", access="stream") + write(10) a + inquire(10, pos=thepos) + if (thepos.ne.17) call abort() + + read(10, pos=1) + inquire(10, pos=thepos) + if (thepos.ne.1) call abort() + + write(10, pos=15) + inquire(10, pos=thepos) + if (thepos.ne.15) call abort() + + read(10, pos=3) + inquire(10, pos=thepos) + if (thepos.ne.3) call abort() + + write(10, pos=1) + inquire(10, pos=thepos) + if (thepos.ne.1) call abort() + + a = 0 + read(10) a + if (any(a /= b)) call abort() + + close(10, status="delete") +end program stream_io_10 diff --git a/gcc/testsuite/gfortran.dg/streamio_9.f90 b/gcc/testsuite/gfortran.dg/streamio_9.f90 new file mode 100644 index 000000000000..150c1c6c3934 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/streamio_9.f90 @@ -0,0 +1,31 @@ +! { dg-do run } +! PR29053 Stream IO test 9. +! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>. +! Test case derived from that given in PR by Steve Kargl. +program pr29053 + implicit none + real dt, t, u, a(10), b(10) + integer i, place + dt = 1.e-6 + a = real( (/ (i, i=1, 10) /) ) + b = a + open(unit=11, file='a.dat', access='stream') + open(unit=12, file='b.dat', access='stream') + do i = 1, 10 + t = i * dt + write(11) t + write(12) a + end do + rewind(11) + rewind(12) + do i = 1, 10 + t = i * dt + read(12) a + if (any(a.ne.b)) call abort() + read(11) u + if (u.ne.t) call abort() + end do + close(11, status="delete") + close(12, status="delete") +end program pr29053 + -- GitLab