streamio_15.f90: Take care of Windows CRLF line terminator.
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Sat, 10 May 2008 20:57:42 +0000 (20:57 +0000)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Sat, 10 May 2008 20:57:42 +0000 (20:57 +0000)
* gfortran.dg/streamio_15.f90: Take care of Windows CRLF line
terminator.

From-SVN: r135162

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/streamio_15.f90

index 30e7426caa4059dc1e607ba8a8dab70e5c7960fc..79cd88a5871d88d62d406b3d455dfc20b86f15bd 100644 (file)
@@ -1,3 +1,8 @@
+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
index 09d9a2af1d3862f00cd2724e3da41da1624e00c9..bbe91f1106d6b7c95496575ba20fa5fff1ab8fc6 100644 (file)
@@ -4,7 +4,15 @@
 program main
   implicit none
   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")
   write(20,'(A)') '123456'
   write(20,'(A)') 'abcdef'
@@ -15,7 +23,7 @@ program main
   if (c.ne.'123456') call abort
   ! Save the position
   inquire(20,pos=i)
-  if (i.ne.8) call abort
+  if (i.ne.7+newline_length) call abort
   ! Read in the complete line...
   read(20,'(A)') c
   if (c.ne.'abcdef') call abort