mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-03 05:10:26 +08:00
re PR fortran/29277 (Formated stream output: Translate "\n" / achar(10) into "\r\n" on some platforms)
2006-10-17 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/29277 * gfortran.dg/streamio_4.f90: Update test. * gfortran.dg/streamio_11.f90: New test. From-SVN: r117847
This commit is contained in:
parent
09861cbee6
commit
94d3995aa3
@ -1,3 +1,9 @@
|
||||
2006-10-17 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR libgfortran/29277
|
||||
* gfortran.dg/streamio_4.f90: Update test.
|
||||
* gfortran.dg/streamio_11.f90: New test.
|
||||
|
||||
2006-10-17 Lee Millward <lee.millward@codesuorcery.com>
|
||||
|
||||
PR c++/27952
|
||||
|
43
gcc/testsuite/gfortran.dg/streamio_11.f90
Normal file
43
gcc/testsuite/gfortran.dg/streamio_11.f90
Normal file
@ -0,0 +1,43 @@
|
||||
! { dg-do run }
|
||||
! PR29277 Stream IO test 11, tests formatted form.
|
||||
! Contributed by Tobias Burnas.
|
||||
program stream_test
|
||||
implicit none
|
||||
character(len=*), parameter :: rec1 = 'record1'
|
||||
character(len=*), parameter :: rec2 = 'record2'
|
||||
character(len=50) :: str1,str2
|
||||
integer :: len, i
|
||||
real :: r
|
||||
|
||||
open(10,form='formatted',access='stream',&
|
||||
status='scratch',position='rewind')
|
||||
write(10,'(a)') rec1//new_line('a')//rec2
|
||||
rewind(10)
|
||||
read(10,*) str1
|
||||
read(10,*) str2
|
||||
if(str1 /= rec1 .or. str2 /= rec2) call abort()
|
||||
rewind(10)
|
||||
read(10,'(a)') str1
|
||||
read(10,'(a)') str2
|
||||
if(str1 /= rec1 .or. str2 /= rec2) call abort()
|
||||
close(10)
|
||||
|
||||
open(10,form='formatted',access='stream',&
|
||||
status='scratch',position='rewind')
|
||||
write(10,*) '123 '//trim(rec1)//' 1e-12'
|
||||
write(10,*) '12345.6789'
|
||||
rewind(10)
|
||||
read(10,*) i,str1
|
||||
read(10,*) r
|
||||
if(i /= 123 .or. str1 /= rec1 .or. r /= 12345.6789) &
|
||||
call abort()
|
||||
close(10)
|
||||
|
||||
open(unit=10,form='unformatted',access='stream', &
|
||||
status='scratch',position='rewind')
|
||||
write(10) rec1//new_line('a')//rec2
|
||||
len = len_trim(rec1//new_line('a')//rec2)
|
||||
rewind(10)
|
||||
read(10) str1(1:len)
|
||||
if(str1 /= rec1//new_line('a')//rec2) call abort()
|
||||
end program stream_test
|
@ -15,7 +15,6 @@ program streamtest
|
||||
do j=0,9
|
||||
write(10,"(i5)") j
|
||||
end do
|
||||
write(10,"(a)") lf
|
||||
end do
|
||||
|
||||
close(10)
|
||||
@ -26,7 +25,6 @@ program streamtest
|
||||
do j=0,9
|
||||
write(10,"(i5)") j
|
||||
end do
|
||||
write(10,"(a)") lf
|
||||
end do
|
||||
rewind(10)
|
||||
do i=1,lines
|
||||
@ -34,8 +32,6 @@ program streamtest
|
||||
read(10,"(i5)") k
|
||||
if (k.ne.j) call abort()
|
||||
end do
|
||||
read(10,"(a)") tchar
|
||||
if (tchar.ne.lf) call abort()
|
||||
end do
|
||||
|
||||
close(10,status="delete")
|
||||
|
Loading…
x
Reference in New Issue
Block a user