summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authortkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-04 20:36:52 +0000
committertkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-04 20:36:52 +0000
commit433b226c1549b4d2dd4a7ad7d07792b4db922851 (patch)
tree980246c419799542558dca9b884df6c9e3881e82 /gcc
parent4a00db2fedf5f75864b94a1b3c65e853dd5a646d (diff)
downloadgcc-433b226c1549b4d2dd4a7ad7d07792b4db922851.tar.gz
2005-09-04 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/23321 * io/transfer.c(data_transfer_init): Check for a too-large record number. Return if sseek failed. 2005-09-04 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/23321 * gfortran.dg/direct_io_4.f90: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103835 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/direct_io_4.f9022
2 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d9a5e534216..0988d1cad03 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2005-09-04 Thomas Koenig <Thomas.Koenig@online.de>
+
+ PR libfortran/23321
+ * gfortran.dg/direct_io_4.f90: New test case.
+
2005-09-04 Andrew Pinski <pinskia@physics.uc.edu>
Rasmus Hahn <rassahah@neofonie.de>
diff --git a/gcc/testsuite/gfortran.dg/direct_io_4.f90 b/gcc/testsuite/gfortran.dg/direct_io_4.f90
new file mode 100644
index 00000000000..05079673514
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/direct_io_4.f90
@@ -0,0 +1,22 @@
+! { dg-do run }
+! PR 23321 : Running off the end of a file was not detected with direct I/O.
+program main
+ implicit none
+ integer(kind=1) :: a, b
+ integer :: ios, i
+
+ a = 42
+ open (unit=10,status="scratch",recl=1,access="direct")
+ write(10,rec=1) a
+
+ read (10,rec=2, iostat=ios) b
+ if (ios == 0) call abort
+
+ read (10, rec=82641, iostat=ios) b ! This used to cause a segfault
+ if (ios == 0) call abort
+
+ read(10, rec=1, iostat=ios) b
+ if (ios /= 0) call abort
+ if (a /= b) call abort
+
+end program main