OSDN Git Service

* gfortran.dg/fseek.f90: Take care of Windows CRLF line
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 10 May 2008 20:47:41 +0000 (20:47 +0000)
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 10 May 2008 20:47:41 +0000 (20:47 +0000)
terminator.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135161 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 8b29d7c..30e7426 100644 (file)
@@ -1,5 +1,10 @@
 2008-05-10  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
+       * gfortran.dg/fseek.f90: Take care of Windows CRLF line
+       terminator.
+
+2008-05-10  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
        * gfortran.dg/fmt_t_5.f90: Take care of Windows CRLF line
        terminator.
 
index acc8211..2bf2e0d 100644 (file)
@@ -3,10 +3,18 @@
 PROGRAM test_fseek
   INTEGER, PARAMETER :: SEEK_SET = 0, SEEK_CUR = 1, SEEK_END = 2, fd=10
   INTEGER :: ierr = 0
+  INTEGER :: newline_length
 
-  ! expected position: 12, one leading blank + 10 + newline
+  ! We first need to determine if a newline is one or two characters
+  open (911,status="scratch")
+  write(911,"()")
+  newline_length = ftell(911)
+  close (911)
+  if (newline_length < 1 .or. newline_length > 2) call abort()
+
+  ! expected position: one leading blank + 10 + newline
   WRITE(fd, *) "1234567890"
-  IF (FTELL(fd) /= 12) CALL abort()
+  IF (FTELL(fd) /= 11 + newline_length) CALL abort()
 
   ! move backward from current position
   CALL FSEEK(fd, -12, SEEK_CUR, ierr)