aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Koenig <Thomas.Koenig@online.de>2006-10-31 20:58:26 +0000
committerThomas Koenig <tkoenig@gcc.gnu.org>2006-10-31 20:58:26 +0000
commit8a7f7fb6dec187cd95566e690e60293302fdd55d (patch)
treef4b1548a82d24a23fccb0e2105d38e471359f8da /gcc
parent401c8e8059870221603c8707272d0d66b3629167 (diff)
downloadgcc-8a7f7fb6dec187cd95566e690e60293302fdd55d.zip
gcc-8a7f7fb6dec187cd95566e690e60293302fdd55d.tar.gz
gcc-8a7f7fb6dec187cd95566e690e60293302fdd55d.tar.bz2
re PR libfortran/29627 ([4.1 only] partial unformatted reads shouldn't succeed)
2006-10-31 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/29627 * libgfortran.h: Add ERROR_SHORT_RECORD * runtime/error.c (translate_error): Add case for ERROR_SHORT_RECORD. * io/transfer.c (read_block_direct): Separate codepaths for stream and record unformatted I/O. Remove unneeded tests for standard input, padding and formatted I/O. If the record is short, read in as much data as possible, then raise the error. 2006-10-31 Thomas Koenig <Thomas.Koenig@online.de> PR libfortran/29627 * gfortran.dg/unf_short_record_1.f90: New test. From-SVN: r118341
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/unf_short_record_1.f9017
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 53ed758..f6f95b3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2006-10-31 Thomas Koenig <Thomas.Koenig@online.de>
+
+ PR libfortran/29627
+ * gfortran.dg/unf_short_record_1.f90: New test.
+
2006-10-31 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR fortran/29067
diff --git a/gcc/testsuite/gfortran.dg/unf_short_record_1.f90 b/gcc/testsuite/gfortran.dg/unf_short_record_1.f90
new file mode 100644
index 0000000..1bb6273
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/unf_short_record_1.f90
@@ -0,0 +1,17 @@
+! { dg-do run }
+! PR 29627 - partial reads of unformatted records
+program main
+ character a(3)
+ character(len=50) msg
+ open(10, form="unformatted", status="unknown")
+ write (10) 'a'
+ write (10) 'c'
+ a = 'b'
+ rewind 10
+ read (10, err=20, iomsg=msg) a
+ call abort
+20 continue
+ if (msg .ne. "Short record on unformatted read") call abort
+ if (a(1) .ne. 'a' .or. a(2) .ne. 'b' .or. a(3) .ne. 'b') call abort
+ close (10, status="delete")
+end program main