diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/write_0_pe_format.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/write_0_pe_format.f90 | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/write_0_pe_format.f90 b/gcc/testsuite/gfortran.dg/write_0_pe_format.f90 new file mode 100644 index 000000000..3890c32ec --- /dev/null +++ b/gcc/testsuite/gfortran.dg/write_0_pe_format.f90 @@ -0,0 +1,9 @@ +! { dg-do run } +! PR libfortran/20101 +! With format "PE", 0.0 must still have "+00" as exponent +character(len=10) :: c1, c2 +write(c1,"(1pe9.2)") 0.0 +write(c2,"(1pe9.2)") 1.0 +if (trim(adjustl(c1)) .ne. "0.00E+00") call abort() +if (trim(adjustl(c2)) .ne. "1.00E+00") call abort() +end |