write.c (output_float): Fix typo in condition.
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
Sun, 27 Feb 2005 16:17:56 +0000 (17:17 +0100)
committerTobias Schlüter <tobi@gcc.gnu.org>
Sun, 27 Feb 2005 16:17:56 +0000 (17:17 +0100)
libgfortran/
* io/write.c (output_float): Fix typo in condition.

gcc/testsuite/
* gfortran.dg/e_d_fmt.f90: New test.

From-SVN: r95615

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/e_d_fmt.f90 [new file with mode: 0644]
libgfortran/ChangeLog
libgfortran/io/write.c

index c13dd7041ff9ebc9860db2ba6ee00f73723a7dec..ef1433f0b83f4975aa08d9853ec6cf58ceb11b6c 100644 (file)
@@ -1,3 +1,7 @@
+2005-02-27  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * gfortran.dg/e_d_fmt.f90: New test.
+
 2005-02-27  Kazu Hirata  <kazu@cs.umass.edu>
 
        * gcc.dg/asm-b.c: Fix comment typos.
diff --git a/gcc/testsuite/gfortran.dg/e_d_fmt.f90 b/gcc/testsuite/gfortran.dg/e_d_fmt.f90
new file mode 100644 (file)
index 0000000..1abfa61
--- /dev/null
@@ -0,0 +1,13 @@
+! { dg-do run }
+! Verify that the D format uses 'D' as the exponent character.
+!   "     "    "  E   "     "   'E' "   "     "         " 
+CHARACTER*10 c1, c2
+REAL*8 r
+r = 1.0
+write(c1,"(e9.2)") r
+write(c2,"(d9.2)") r
+
+if (trim(adjustl(c1)) .ne. "0.10E+01") call abort()
+if (trim(adjustl(c2)) .ne. "0.10D+01") call abort()
+
+END
index 03793e852acb2e147880607ec2e832ffa56e451d..c7b5821e890dfa3f75081d522dc710f0dd489dc4 100644 (file)
@@ -1,3 +1,7 @@
+2004-02-27  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       * io/write.c (output_float): Fix typo in condition.
+
 2005-02-25  Peter O'Gorman  <peter@pogman.com>
             Toon Moene  <toon@moene.indiv.nluug.nl>
 
index 19744d294c0a52c956caa6555f7661a500b5e2e9..d4ee605de298205420120a7c0b1ca8c26f6d281a 100644 (file)
@@ -395,7 +395,7 @@ output_float (fnode *f, double value, int len)
          nafter = d;
        }
 
-      if (ft = FMT_E)
+      if (ft == FMT_E)
        expchar = 'E';
       else
        expchar = 'D';