diff options
author | Paul Brook <paul@codesourcery.com> | 2004-08-31 15:53:31 +0000 |
---|---|---|
committer | Paul Brook <pbrook@gcc.gnu.org> | 2004-08-31 15:53:31 +0000 |
commit | bd72d66cb5f8450f631da7149bf066f865d56338 (patch) | |
tree | eeec759a476bd4d9d5f8e220e891469fe79a14bb /gcc | |
parent | c789f36b216c9318b7f5fadb3a632f91513e3156 (diff) | |
download | gcc-bd72d66cb5f8450f631da7149bf066f865d56338.zip gcc-bd72d66cb5f8450f631da7149bf066f865d56338.tar.gz gcc-bd72d66cb5f8450f631da7149bf066f865d56338.tar.bz2 |
transfer.c (read_sf): Rename uinty to readlen.
* io/transfer.c (read_sf): Rename uinty to readlen. Detect EOF.
(finalize_transfer): Move setjmp after namlist IO.
* io/unix.c (mem_alloc_r_at): Calculate remaining length correctly.
testsuite/
* gfortran.dg/eof_1.f90: New test.
From-SVN: r86831
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/eof_1.f90 | 18 |
2 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0bca0f1..df86733 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2004-08-31 Paul Brook <paul@codesourcery.com> + * gfortran.dg/eof_1.f90: New test. + +2004-08-31 Paul Brook <paul@codesourcery.com> + * gfortran.dg/list_read_1.f90: New file. 2004-08-30 Mark Mitchell <mark@codesourcery.com> diff --git a/gcc/testsuite/gfortran.dg/eof_1.f90 b/gcc/testsuite/gfortran.dg/eof_1.f90 new file mode 100644 index 0000000..05726bd --- /dev/null +++ b/gcc/testsuite/gfortran.dg/eof_1.f90 @@ -0,0 +1,18 @@ +! { dg-do run } +! Program to test for proper EOF errors when reading past the end of a file. +! We used to get this wrong when a formatted read followed a list formatted +! read. +program eof_1 + character(len=5) :: s + + open (unit=11, status="SCRATCH") + write (11, '(a)') "Hello" + rewind(11) + read(11, *) s + if (s .ne. "Hello") call abort + read(11, '(a5)', end=10) s + call abort +10 continue + close (11) +end + |