summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/pr16597.f9027
2 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9b73b6dea53..18f803758a6 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-08-27 Bud Davis <bdavis9659@comcast.net>
+
+ PR fortran/16597
+ * gfortran.dg/pr16597.f90: New test.
+
2004-08-26 Joseph S. Myers <jsm@polyomino.org.uk>
PR c/13801
diff --git a/gcc/testsuite/gfortran.dg/pr16597.f90 b/gcc/testsuite/gfortran.dg/pr16597.f90
new file mode 100644
index 00000000000..ff1dcb838ae
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr16597.f90
@@ -0,0 +1,27 @@
+! pr 16597
+! libgfortran
+! reading a direct access record after it was written did
+! not always return the correct data.
+
+ program gfbug4
+ implicit none
+
+ integer strlen
+ parameter (strlen = 4)
+
+ integer iunit
+ character string *4
+
+ iunit = 99
+ open (UNIT=iunit,FORM='unformatted',ACCESS='direct',RECL=strlen)
+ write (iunit, rec=1) 'ABCD'
+ read (iunit, rec=1) string
+ close (iunit)
+ if (string.ne.'ABCD') call abort
+
+ open (UNIT=iunit,FORM='unformatted',ACCESS='direct',STATUS='scratch',RECL=strlen)
+ write (iunit, rec=1) 'ABCD'
+ read (iunit, rec=1) string
+ close (iunit)
+ if (string.ne.'ABCD') call abort
+ end