Interesting gotcha with test cases
Dominique Dhumieres
dominiq@lps.ens.fr
Tue Feb 22 10:59:00 GMT 2011
Jerry,
> The test case actually has run time failures in it. ...
The following patch fixes the failures at runtime (with 16 passes):
--- /opt/gcc/_clean/gcc/testsuite/gfortran.dg/fmt_f0_1.f90 2011-02-19 16:44:54.000000000 +0100
+++ /opt/gcc/work/gcc/testsuite/gfortran.dg/fmt_f0_1.f90 2011-02-22 11:48:56.000000000 +0100
@@ -1,4 +1,4 @@
-! { dg-do run )
+! { dg-do run }
! PR39304 write of 0.0 with F0.3 gives **
! Test case developed from case provided by reporter.
REAL :: x
@@ -7,13 +7,13 @@
write (str,'(f0.0)') x
if (str.ne."0.") call abort
write (str,'(f0.1)') x
- if (str.ne."0.0") call abort
+ if (str.ne.".0") call abort
write (str,'(f0.2)') x
- if (str.ne."0.00") call abort
+ if (str.ne.".00") call abort
write (str,'(f0.3)') x
- if (str.ne."0.000") call abort
+ if (str.ne.".000") call abort
write (str,'(f0.4)') x
- if (str.ne."0.0000") call abort
+ if (str.ne.".0000") call abort
write (str,'(F0.0)') 0.0
if (str.ne."0.") call abort
write (str,'(F0.0)') 0.001
@@ -31,7 +31,7 @@
write (str,'(F1.0)') 0.1
if (str.ne."*") call abort
write (str,'(F2.0)') -0.001
- if (str.ne."*") call abort
+ if (str.ne."**") call abort
write (str,'(F2.0)') -0.01
if (str.ne."**") call abort
write (str,'(F2.0)') -0.1
> Fortunately I am the only one to do this with a test case. :)
See http://gcc.gnu.org/ml/fortran/2011-02/msg00219.html ;-)
Cheers,
Dominique
More information about the Fortran
mailing list