Commit e2c7c14d by Francois-Xavier Coudert Committed by François-Xavier Coudert

streamio_15.f90: Take care of Windows CRLF line terminator.

	* gfortran.dg/streamio_15.f90: Take care of Windows CRLF line
	terminator.

From-SVN: r135162
parent d97a4451
2008-05-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> 2008-05-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* gfortran.dg/streamio_15.f90: Take care of Windows CRLF line
terminator.
2008-05-10 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* gfortran.dg/fseek.f90: Take care of Windows CRLF line * gfortran.dg/fseek.f90: Take care of Windows CRLF line
terminator. terminator.
...@@ -4,7 +4,15 @@ ...@@ -4,7 +4,15 @@
program main program main
implicit none implicit none
character(len=6) :: c character(len=6) :: c
integer :: i integer :: i, newline_length
open(20,status="scratch",access="stream",form="formatted")
write(20,"()")
inquire(20,pos=newline_length)
newline_length = newline_length - 1
if (newline_length < 1 .or. newline_length > 2) call abort
close(20)
open(20,file="foo.txt",form="formatted",access="stream") open(20,file="foo.txt",form="formatted",access="stream")
write(20,'(A)') '123456' write(20,'(A)') '123456'
write(20,'(A)') 'abcdef' write(20,'(A)') 'abcdef'
...@@ -15,7 +23,7 @@ program main ...@@ -15,7 +23,7 @@ program main
if (c.ne.'123456') call abort if (c.ne.'123456') call abort
! Save the position ! Save the position
inquire(20,pos=i) inquire(20,pos=i)
if (i.ne.8) call abort if (i.ne.7+newline_length) call abort
! Read in the complete line... ! Read in the complete line...
read(20,'(A)') c read(20,'(A)') c
if (c.ne.'abcdef') call abort if (c.ne.'abcdef') call abort
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment