mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-10 18:20:51 +08:00
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:
parent
94a73152cc
commit
80aea554a7
@ -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
|
||||
|
@ -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
|
||||
|
17
gcc/testsuite/gfortran.dg/list_read_7.f90
Normal file
17
gcc/testsuite/gfortran.dg/list_read_7.f90
Normal 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
|
Loading…
x
Reference in New Issue
Block a user