aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2004-08-31 15:53:31 +0000
committerPaul Brook <pbrook@gcc.gnu.org>2004-08-31 15:53:31 +0000
commitbd72d66cb5f8450f631da7149bf066f865d56338 (patch)
treeeeec759a476bd4d9d5f8e220e891469fe79a14bb /gcc/testsuite/gfortran.dg
parentc789f36b216c9318b7f5fadb3a632f91513e3156 (diff)
downloadgcc-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/testsuite/gfortran.dg')
-rw-r--r--gcc/testsuite/gfortran.dg/eof_1.f9018
1 files changed, 18 insertions, 0 deletions
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
+