diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2019-11-24 19:16:23 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2019-11-24 19:16:23 +0000 |
commit | 859174c82493971bd1e408231e24a7724953042f (patch) | |
tree | 21b49de0efcc442137d20845c6e5444df0a575a1 /gcc | |
parent | af4e8d4d5aa3a13bc9e2a8aa50341043e8ad6c61 (diff) | |
download | gcc-859174c82493971bd1e408231e24a7724953042f.zip gcc-859174c82493971bd1e408231e24a7724953042f.tar.gz gcc-859174c82493971bd1e408231e24a7724953042f.tar.bz2 |
Fix EOF handling for arrays.
2019-11-23 Thomas Koenig <tkoenig@gcc.gnu.org>
Harald Anlauf <anlauf@gmx.de>
PR fortran/92569
* io/transfer.c (transfer_array_inner): If position is
at AFTER_ENDFILE in current unit, return from data loop.
2019-11-23 Thomas Koenig <tkoenig@gcc.gnu.org>
Harald Anlauf <anlauf@gmx.de>
PR fortran/92569
* gfortran.dg/eof_6.f90: New test.
Co-Authored-By: Harald Anlauf <anlauf@gmx.de>
From-SVN: r278659
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/eof_6.f90 | 23 |
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2135c2f..9ff8a95 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,4 +1,10 @@ 2019-11-23 Thomas Koenig <tkoenig@gcc.gnu.org> + Harald Anlauf <anlauf@gmx.de> + + PR fortran/92569 + * gfortran.dg/eof_6.f90: New test. + +2019-11-23 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/92422 * gfortran.dg/bounds_check_21.f90: New test. diff --git a/gcc/testsuite/gfortran.dg/eof_6.f90 b/gcc/testsuite/gfortran.dg/eof_6.f90 new file mode 100644 index 0000000..1c15557 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/eof_6.f90 @@ -0,0 +1,23 @@ +! { dg-do run } +! { dg-options "-ffrontend-optimize" } +! PR 92569 - the EOF condition was not recognized with +! -ffrontend-optimize. Originjal test case by Bill Lipa. +program main + implicit none + real(kind=8) :: tdat(1000,10) + real(kind=8) :: res (10, 3) + integer :: i, j, k, np + + open (unit=20, status="scratch") + res = reshape([(real(i),i=1,30)], shape(res)) + write (20,'(10G12.5)') res + rewind 20 + do j = 1,1000 + read (20,*,end=1)(tdat(j,k),k=1,10) + end do + +1 continue + np = j-1 + if (np /= 3) stop 1 + if (any(transpose(res) /= tdat(1:np,:))) stop 2 +end program main |