From: fxcoudert Date: Wed, 23 Mar 2005 21:42:10 +0000 (+0000) Subject: PR libfortran/18025 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=70952ee73f4ca4dc9fdf317a7e0290a42caa18ad;p=thirdparty%2Fgcc.git PR libfortran/18025 * write.c (output_float): Handling the "F0.d" format similarly as commercial compilers. * pr18025.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96953 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 84a73de14e3a..465d516f4513 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2005-03-23 Francois-Xavier Coudert + + * pr18025.f90: New test. + 2005-03-23 Dale Johannesen * gcc.dg/20020312-2.c: Fix for non-PowerPC Darwin. diff --git a/gcc/testsuite/gfortran.dg/pr18025.f90 b/gcc/testsuite/gfortran.dg/pr18025.f90 new file mode 100644 index 000000000000..69a6af6ffa99 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr18025.f90 @@ -0,0 +1,8 @@ +! PR libfortran/18025 +! {dg-do run} + character(len=80) :: c + write(c, "('#',F0.2,'#')") 1.23 + if (c /= '#1.23#') call abort + write(c, "('#',F0.2,'#')") -1.23 + if (c /= '#-1.23#') call abort + end diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index c32ca525b434..a3964b702ffb 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2005-02-27 Francois-Xavier Coudert + + PR libfortran/18025 + * write.c (output_float): Handling the "F0.d" format similarly as + commercial compilers. + 2005-03-22 Francois-Xavier Coudert * Makefile.am: Added new files. diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c index 88e5280b3383..d22aa344b056 100644 --- a/libgfortran/io/write.c +++ b/libgfortran/io/write.c @@ -537,7 +537,7 @@ output_float (fnode *f, double value, int len) /* Pick a field size if none was specified. */ if (w <= 0) - w = nbefore + nzero + nafter + 2; + w = nbefore + nzero + nafter + (sign != SIGN_NONE ? 2 : 1) /* Create the ouput buffer. */ out = write_block (w);