diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c425e3ac1d4..d5a648edbf4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2010-06-18 Jerry DeLisle + + PR libfortran/44477 + * gfortran.dg/eof_3.f90 + * gfortran.dg/endfile_2.f90 + * gfortran.dg/endfile_4.f90 + * gfortran.dg/endfile_3.f90 + 2010-06-18 John David Anglin PR c++/41090 diff --git a/gcc/testsuite/gfortran.dg/endfile_2.f90 b/gcc/testsuite/gfortran.dg/endfile_2.f90 index e91e80eb2aa..ee911e89e9e 100644 --- a/gcc/testsuite/gfortran.dg/endfile_2.f90 +++ b/gcc/testsuite/gfortran.dg/endfile_2.f90 @@ -5,7 +5,7 @@ integer i endfile(8) rewind(8) - read(8,end=0023)i + read(8,*,end=0023)i call abort ! should never get here stop 0023 continue diff --git a/gcc/testsuite/gfortran.dg/endfile_3.f90 b/gcc/testsuite/gfortran.dg/endfile_3.f90 new file mode 100644 index 00000000000..0c413145c5d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/endfile_3.f90 @@ -0,0 +1,9 @@ +! { dg-do run } +! pr44477 READ/WRITE not allowed after ENDFILE +!------------------------------------------- + open(10, form='formatted', & + action='write', position='rewind', status="scratch") + endfile(10) + write(10,'(a)') "aa" ! { dg-shouldfail "Cannot perform ENDFILE" } +end + diff --git a/gcc/testsuite/gfortran.dg/endfile_4.f90 b/gcc/testsuite/gfortran.dg/endfile_4.f90 new file mode 100644 index 00000000000..a2462c9f878 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/endfile_4.f90 @@ -0,0 +1,8 @@ +! { dg-do run } +! pr44477 ENDFILE not allowed after ENDFILE +!------------------------------------------- + open(10, form='formatted', & + action='write', position='rewind', status="scratch") + endfile(10) + endfile(10) ! { dg-shouldfail "Cannot perform ENDFILE" } +end diff --git a/gcc/testsuite/gfortran.dg/eof_3.f90 b/gcc/testsuite/gfortran.dg/eof_3.f90 index 83d652912bc..f1d5098c77b 100644 --- a/gcc/testsuite/gfortran.dg/eof_3.f90 +++ b/gcc/testsuite/gfortran.dg/eof_3.f90 @@ -4,5 +4,6 @@ program test open(unit=32,status="scratch",access="sequential",form="unformatted") read(32,end=100) 100 continue +backspace(32) write (32) end program test