[PATCH] D128261: [Fortran] Relax tolerance for FCVS tests

Diana Picus via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 05:17:00 PDT 2022


rovka created this revision.
rovka added reviewers: awarzynski, kiranchandramohan, Meinersbur, sscalpone, naromero77.
rovka added a project: Flang.
Herald added subscribers: jdoerfert, kristof.beyls, mgorny.
Herald added a project: All.
rovka requested review of this revision.

In one of the tests from FM905.f, flang and gfortran disagree about how
0.25e-10 should be printed: flang prints 2.5e-11, whereas gfortran
prints 2.50000003E-11 (*). The reference output contains the latter, but
that is too far from the correct value, and fpcmp errors out:

      

test-suite/tools/fpcmp-target:
Compared: 2.500000e-11 and 2.500000e-11
abs. diff = 3.000000e-19 rel.diff = 1.200000e-08
Out of tolerance: rel/abs: 1.000000e-08/0.000000e+00

      

This patch does 2 things:

- relaxes the tolerance for the FCVS tests to permit both values, since

they are both close enough (the absolute difference is small)

- uses the value produced by flang in the reference output (since it

actually matches the true value)

      

(*) These results were obtained on an AArch64 Ubuntu machine.


Repository:
  rT test-suite

https://reviews.llvm.org/D128261

Files:
  Fortran/UnitTests/fcvs21_f95/CMakeLists.txt
  Fortran/UnitTests/fcvs21_f95/FM905.reference_output


Index: Fortran/UnitTests/fcvs21_f95/FM905.reference_output
===================================================================
--- Fortran/UnitTests/fcvs21_f95/FM905.reference_output
+++ Fortran/UnitTests/fcvs21_f95/FM905.reference_output
@@ -42,7 +42,7 @@
        2.5
      4    INSPECT
                  COMPUTED= 
-   2.50000003E-11  0.250000000       250.000000       2.50000000E+09
+   2.5E-11  0.250000000       250.000000       2.50000000E+09
                  CORRECT=  
         2.5E-11  0.25  250.0   2.5E+09
      5    INSPECT
Index: Fortran/UnitTests/fcvs21_f95/CMakeLists.txt
===================================================================
--- Fortran/UnitTests/fcvs21_f95/CMakeLists.txt
+++ Fortran/UnitTests/fcvs21_f95/CMakeLists.txt
@@ -45,7 +45,7 @@
   list(FILTER Source EXCLUDE REGEX "FM509\.f$")
 endif()
 
-set(FP_TOLERANCE 1.0e-11) # set by the most sensitive numerical test
+set(FP_TOLERANCE 1.0e-7) # set by the most sensitive numerical test
 set(FP_IGNOREWHITESPACE ON) # list-directed output has flexible whitespace
 llvm_singlesource()
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128261.438649.patch
Type: text/x-patch
Size: 1069 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220621/fba54eb3/attachment.bin>


More information about the llvm-commits mailing list