summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2006-05-29 23:42:55 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2006-05-29 23:42:55 +0000
commit2d564b9ffb16e9687f88b863ef8b9900518f16f6 (patch)
tree703e50fb1e0806e9fe0af53c7c465506bb210153 /gcc
parent22b2be06ecd3d6d154fad17e13f49b8a2df6d207 (diff)
downloadgcc-2d564b9ffb16e9687f88b863ef8b9900518f16f6.tar.gz
re PR libfortran/27757 (Problems with direct access io)
2006-05-29 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/27757 * gfortran.dg/direct_io_5.f90: New test. From-SVN: r114221
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/direct_io_5.f9033
2 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2d4e2547079..37ab802318d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2006-05-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+ PR libgfortran/27757
+ * gfortran.dg/direct_io_5.f90: New test.
+
+2006-05-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
PR libgfortran/27634
* gfortran.dg/fmt_missing_period_1.f: New test.
* gfortran.dg/fmt_missing_period_2.f: New test.
diff --git a/gcc/testsuite/gfortran.dg/direct_io_5.f90 b/gcc/testsuite/gfortran.dg/direct_io_5.f90
new file mode 100644
index 00000000000..62139984452
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/direct_io_5.f90
@@ -0,0 +1,33 @@
+! { dg-do run }
+! PR27757 Problems with direct access I/O
+! This test checks a series of random writes followed by random reads.
+! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+program testdirect
+ implicit none
+ integer, dimension(100) :: a
+ integer :: i,j,k,ier
+ real :: x
+ data a / 13, 9, 34, 41, 25, 98, 6, 12, 11, 44, 79, 3,&
+ & 64, 61, 77, 57, 59, 2, 92, 38, 71, 64, 31, 60, 28, 90, 26,&
+ & 97, 47, 26, 48, 96, 95, 82, 100, 90, 45, 71, 71, 67, 72,&
+ & 76, 94, 49, 85, 45, 100, 22, 96, 48, 13, 23, 40, 14, 76, 99,&
+ & 96, 90, 65, 2, 8, 60, 96, 19, 45, 1, 100, 48, 91, 20, 92,&
+ & 72, 81, 59, 24, 37, 43, 21, 54, 68, 31, 19, 79, 63, 41,&
+ & 42, 12, 10, 62, 43, 9, 30, 9, 54, 35, 4, 5, 55, 3, 94 /
+
+ open(unit=15,file="testdirectio",access="direct",form="unformatted",recl=89)
+ do i=1,100
+ k = a(i)
+ write(unit=15, rec=k) k
+ enddo
+ do j=1,100
+ read(unit=15, rec=a(j), iostat=ier) k
+ if (ier.ne.0) then
+ call abort()
+ else
+ if (a(j) /= k) call abort()
+ endif
+ enddo
+ close(unit=15, status="delete")
+end program testdirect \ No newline at end of file