From: Francois-Xavier Coudert Date: Sat, 10 May 2008 20:47:41 +0000 (+0000) Subject: fseek.f90: Take care of Windows CRLF line terminator. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d97a4451be8c81c8984b71403106b70bbf69299d;p=gcc.git fseek.f90: Take care of Windows CRLF line terminator. * gfortran.dg/fseek.f90: Take care of Windows CRLF line terminator. From-SVN: r135161 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8b29d7c98b4..30e7426caa4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-05-10 Francois-Xavier Coudert + + * gfortran.dg/fseek.f90: Take care of Windows CRLF line + terminator. + 2008-05-10 Francois-Xavier Coudert * gfortran.dg/fmt_t_5.f90: Take care of Windows CRLF line diff --git a/gcc/testsuite/gfortran.dg/fseek.f90 b/gcc/testsuite/gfortran.dg/fseek.f90 index acc8211a414..2bf2e0dc8dd 100644 --- a/gcc/testsuite/gfortran.dg/fseek.f90 +++ b/gcc/testsuite/gfortran.dg/fseek.f90 @@ -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)