re PR fortran/33400 (Formatted read fails if line ends without line break)

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.

From-SVN: r128892
This commit is contained in:
Jerry DeLisle 2007-09-30 14:36:40 +00:00
parent 94a73152cc
commit 80aea554a7
3 changed files with 26 additions and 3 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -11,10 +11,10 @@
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

View File

@ -0,0 +1,17 @@
! { 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