From 2b70275ee1b0de038324280276a9edebcaa93d90 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Thu, 2 Jan 2020 00:57:31 +0000 Subject: PR 90374 d0.d, e0.d, es0.d, en0.d, g0.d and ew.d edit descriptors. PR libfortran/90274 * io/format.c (parse_format_list): Implement the E0 exponent width to provide smallest possible width for exponent fields. Refactor code for correct parsing and better readability of the code. * io/io.h (write_real_w0): Change interface to pass in pointer to fnode. * io/transfer.c: Update all calls to write_real_w0 to use the new interface. * io/write.c ((write_real_w0): Use the new interface with fnode to access both the decimal precision and exponent widths used in build_float_string. * io/write_float.def (build_float_string): Use the passed in exponent width to calculate the used width in the case of E0. From-SVN: r279828 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/fmt_zero_width.f90 | 26 ++++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) (limited to 'gcc') diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 12f934d..1ccff57 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-01-01 Jerry DeLisle + + PR libfortran/90374 + * gfortran.dg/fmt_zero_width.f90: Update test case. + 2020-01-01 Thomas Koenig PR fortran/93113 diff --git a/gcc/testsuite/gfortran.dg/fmt_zero_width.f90 b/gcc/testsuite/gfortran.dg/fmt_zero_width.f90 index 640b673..db2cca6 100644 --- a/gcc/testsuite/gfortran.dg/fmt_zero_width.f90 +++ b/gcc/testsuite/gfortran.dg/fmt_zero_width.f90 @@ -9,32 +9,34 @@ program pr90374 rn = 0.00314_4 afmt = "(D0.3)" write (aresult,fmt=afmt) rn - if (aresult /= "0.314D-02") stop 12 + if (aresult /= "0.314D-2") stop 12 afmt = "(E0.10)" write (aresult,fmt=afmt) rn - if (aresult /= "0.3139999928E-02") stop 15 + if (aresult /= "0.3139999928E-2") stop 15 afmt = "(ES0.10)" write (aresult,fmt=afmt) rn - if (aresult /= "3.1399999280E-03") stop 18 + if (aresult /= "3.1399999280E-3") stop 18 afmt = "(EN0.10)" write (aresult,fmt=afmt) rn - if (aresult /= "3.1399999280E-03") stop 21 + if (aresult /= "3.1399999280E-3") stop 21 afmt = "(G0.10)" write (aresult,fmt=afmt) rn - if (aresult /= "0.3139999928E-02") stop 24 + if (aresult /= "0.3139999928E-2") stop 24 afmt = "(E0.10e0)" write (aresult,fmt=afmt) rn - if (aresult /= "0.3139999928E-02") stop 27 + if (aresult /= "0.3139999928E-2") stop 27 write (aresult,fmt="(D0.3)") rn - if (aresult /= "0.314D-02") stop 29 + if (aresult /= "0.314D-2") stop 29 write (aresult,fmt="(E0.10)") rn - if (aresult /= "0.3139999928E-02") stop 31 + if (aresult /= "0.3139999928E-2") stop 31 write (aresult,fmt="(ES0.10)") rn - if (aresult /= "3.1399999280E-03") stop 33 + if (aresult /= "3.1399999280E-3") stop 33 write (aresult,fmt="(EN0.10)") rn - if (aresult /= "3.1399999280E-03") stop 35 + if (aresult /= "3.1399999280E-3") stop 35 write (aresult,fmt="(G0.10)") rn - if (aresult /= "0.3139999928E-02") stop 37 + if (aresult /= "0.3139999928E-2") stop 37 write (aresult,fmt="(E0.10e0)") rn - if (aresult /= "0.3139999928E-02") stop 39 + if (aresult /= "0.3139999928E-2") stop 39 + write (aresult,fmt="(E0.10e3)") rn + if (aresult /= ".3139999928E-002") stop 41 end -- cgit v1.1