diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/output_exponents_1.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/output_exponents_1.f90 | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/output_exponents_1.f90 b/gcc/testsuite/gfortran.dg/output_exponents_1.f90 new file mode 100644 index 000000000..db47b0bfc --- /dev/null +++ b/gcc/testsuite/gfortran.dg/output_exponents_1.f90 @@ -0,0 +1,15 @@ +! { dg-do run } +! { dg-options "-std=legacy" } +! +! PR 21376 +! we used to take the logarithm of zero in this special case + character*10 c + write (c,'(e10.4)') 1.0 + if(c /= "0.1000E+01") call abort + write (c,'(e10.4)') 0.0 + if(c /= "0.0000E+00") call abort + write (c,'(e10.4)') 1.0d100 + if(c /= "0.1000+101") call abort + write (c,'(e10.4)') 1.0d-102 + if(c /= "0.1000-101") call abort +end |