From: Tobias Burnus Date: Sun, 24 Mar 2013 10:16:33 +0000 (+0100) Subject: re PR libfortran/56696 (Formatted (list-directed) input fails to signal end of record) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a73421c460287b7a1b9f0c35d9fe7eacd0e51832;p=gcc.git re PR libfortran/56696 (Formatted (list-directed) input fails to signal end of record) 2013-03-24 Tobias Burnus PR fortran/56696 * io/list_read.c (read_real): Fix EOF diagnostic. 2013-03-24 Tobias Burnus PR fortran/56696 * gfortran.dg/eof_5.f90: New. From-SVN: r197019 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 88a14e41c5c..8e39514d90c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-03-24 Tobias Burnus + + PR fortran/56696 + * gfortran.dg/eof_5.f90: New. + 2013-03-23 Sebastian Huber * gcc.c-torture/execute/builtins/builtins.exp: Sort targets diff --git a/gcc/testsuite/gfortran.dg/eof_5.f90 b/gcc/testsuite/gfortran.dg/eof_5.f90 new file mode 100644 index 00000000000..88671ba2374 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/eof_5.f90 @@ -0,0 +1,21 @@ +! { dg-do run } +! +! PR fortran/56696 +! +! Contributed by Keith Refson +! + +program iotest + character(len=258) :: inp = ' 1.0 1.0 1.0' + character(len=7) :: inp2 = '1 2 3 4' + integer :: ios + real :: a1, a2, a3, a4 + + read(inp2,*,iostat=ios) a1, a2, a3, a4 + if (ios /= 0) call abort () + + read(inp,*,iostat=ios) a1, a2, a3, a4 + if (ios == 0) call abort () +! write(*,*) 'IOSTAT=',ios +end program iotest + diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 877d2d0c959..865725fbffa 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2013-03-24 Tobias Burnus + + PR fortran/56696 + * io/list_read.c (read_real): Fix EOF diagnostic. + 2013-03-20 Tilo Schwarz PR libfortran/51825 diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index aa7c8c0d2c1..e7ae98fcf28 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -1433,7 +1433,6 @@ read_real (st_parameter_dt *dtp, void * dest, int length) goto got_sign; CASE_SEPARATORS: - case EOF: unget_char (dtp, c); /* Single null. */ eat_separator (dtp); return;