diff options
author | Francois-Xavier Coudert <coudert@clipper.ens.fr> | 2005-11-27 12:42:46 +0100 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2005-11-27 11:42:46 +0000 |
commit | 8824fd4cc119ccbeaab451122d5cbff6971bf958 (patch) | |
tree | 01365c36dc1d3c013aab270a069fc3359416ae3c /gcc | |
parent | 8edbdaf7352ccfcf7a18650dca29695038d2978c (diff) | |
download | gcc-8824fd4cc119ccbeaab451122d5cbff6971bf958.zip gcc-8824fd4cc119ccbeaab451122d5cbff6971bf958.tar.gz gcc-8824fd4cc119ccbeaab451122d5cbff6971bf958.tar.bz2 |
re PR libfortran/24919 ([4.0] CRLF support in libgfortran)
PR libfortran/24919
* io/list_read.c (eat_separator, finish_separator,
read_character): Handle CRLF separators correctly during reads.
(nml_query): Use the HAVE_CRLF macro to print adequate newlines.
* io/io.h (st_parameter_dt): Add comment about the possible
values for sf_seen_eor.
* io/unix.c (tempfile, regular_file): HAVE_CRLF doesn't imply
that O_BINARY is defined, so we add that condition.
(stream_at_bof): Fix typo in comment.
* io/transfer.c (read_sf): Handle correctly CRLF, setting
sf_seen_eor value to 2 instead of 1.
(formatted_transfer_scalar): Use the sf_seen_eor value to
handle CRLF the right way.
* io/write.c (nml_write_obj, namelist_write): Use CRLF as newline
when HAVE_CRLF is defined.
* gfortran.dg/ftell_1.f90: Modify testcase so that it doesn't
fail on CRLF platforms.
* gfortran.dg/ftell_2.f90: Likewise.
From-SVN: r107563
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/ftell_1.f90 | 7 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/ftell_2.f90 | 6 |
3 files changed, 17 insertions, 3 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4ce34eb..66bf1af 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2005-11-27 Francois-Xavier Coudert <coudert@clipper.ens.fr> + + PR libfortran/24919 + * gfortran.dg/ftell_1.f90: Modify testcase so that it doesn't + fail on CRLF platforms. + * gfortran.dg/ftell_2.f90: Likewise. + 2005-11-26 Eric Christopher <echristo@apple.com> * gcc.dg/intmax_t-1.c: Remove mips xfail. diff --git a/gcc/testsuite/gfortran.dg/ftell_1.f90 b/gcc/testsuite/gfortran.dg/ftell_1.f90 index bd154f1..eb09caf 100644 --- a/gcc/testsuite/gfortran.dg/ftell_1.f90 +++ b/gcc/testsuite/gfortran.dg/ftell_1.f90 @@ -1,12 +1,15 @@ ! { dg-do run } - integer*8 o + integer*8 o, o2 open (10, status="scratch") call ftell (10, o) if (o /= 0) call abort write (10,"(A)") "1234567" call ftell (10, o) - if (o /= 8) call abort + if (o /= 8 .and. o /= 9) call abort + write (10,"(A)") "1234567" + call ftell (10, o2) + if (o2 /= 2 * o) call abort close (10) call ftell (10, o) if (o /= -1) call abort diff --git a/gcc/testsuite/gfortran.dg/ftell_2.f90 b/gcc/testsuite/gfortran.dg/ftell_2.f90 index 1dda1fb..a6fc1c1 100644 --- a/gcc/testsuite/gfortran.dg/ftell_2.f90 +++ b/gcc/testsuite/gfortran.dg/ftell_2.f90 @@ -1,8 +1,12 @@ ! { dg-do run } + integer*8 o open (10, status="scratch") if (ftell(10) /= 0) call abort write (10,"(A)") "1234567" - if (ftell(10) /= 8) call abort + if (ftell(10) /= 8 .and. ftell(10) /= 9) call abort + o = ftell(10) + write (10,"(A)") "1234567" + if (ftell(10) /= 2 * o) call abort close (10) if (ftell(10) /= -1) call abort end |