+2007-09-30 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/33400
+ * gfortran.dg/PR19872.f: Fix test condition.
+ * gfortran.dg/list_read_7.f90: New test.
+
2007-09-30 Uros Bizjak <ubizjak@gmail.com>
PR tree-optimization/33597
close(1)
open(1,form='FORMATTED')
read(1,*)i
- if(i(1).ne.9.and.i(2).ne.8.and.i(3).ne.7.and.i(4).ne.9)call abort
- read(1,*,end=200)i
+ if(i(1).ne.9.or.i(2).ne.8.or.i(3).ne.7.or.i(4).ne.6)call abort
+ read(1,*, end=200)i
! should only be able to read one line from the file
call abort
200 continue
- close(1,STATUS='DELETE')
+ close(1,STATUS='delete')
end
--- /dev/null
+! { dg-do run }
+! PR33400 Formatted read fails if line ends without line break
+! Test case modified from that in PR by <jvdelisle@gcc.gnu.org>
+integer, parameter :: fgsl_strmax = 128
+character(len=fgsl_strmax) :: ieee_str1, ieee_str2
+open(unit=20, file='test.dat',form='FORMATTED')
+write(20,'(a)',advance="no") ' 1.01010101010101010101010101010101&
+ &01010101010101010101*2^-2 1.01010101010101010101011*2^-2'
+rewind(20)
+read(20, fmt=*) ieee_str1, ieee_str2
+if (trim(ieee_str1) /= &
+ '1.0101010101010101010101010101010101010101010101010101*2^-2') &
+ call abort
+if (trim(ieee_str2) /= &
+ '1.01010101010101010101011*2^-2') &
+ call abort
+end