diff gcc/testsuite/gfortran.dg/endfile.f @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/gfortran.dg/endfile.f	Fri Oct 27 22:46:09 2017 +0900
@@ -0,0 +1,18 @@
+! { dg-do run }
+! PR25550 file data corrupted after reading end of file.
+! Derived from example given in PR from Dale Ranta.
+! Contributed by Jerry DeLisle  <jvdelisle@gcc.gnu.org> 
+      integer data
+      data=-1
+      open(unit=11,status='scratch',form='unformatted')
+      write(11)data
+      read(11,end=1000 )data
+      call abort()
+ 1000 continue
+      rewind (11)
+      read(11)data
+ 1001 continue
+      if(data.ne.-1) call abort
+      end
+
+