On Tue, Dec 16, 2025 at 11:39:48PM +0000, Iain Sandoe wrote:
>
>
> > On 15 Dec 2025, at 05:34, Jerry D <[email protected]> wrote:
> >
> > Hi all,
> >
> > I was looking through the testsuite in gfortran.dg and found the following
> > in bessel_6.f90.
> >
> > ! { dg-add-options ieee }
> >
> > This is at the top with no other directives. The documentation I find in
> > online docs does not mention this option ieee. It does say "dg-add-options"
> > must be preceded by a dg-do run. There is no dg-do anything anywhere.
> >
> > So what exactly is this supposed to do?
>
>
> dg-add-options XXXXX
>
> gets translated into
> add_options_for_XXXXX
>
> which is supposed to add any target-specific options needed to support XXXXX
>
> in this case;
>
> # Add to FLAGS all the target-specific flags needed to enable
> # full IEEE compliance mode.
>
> proc add_options_for_ieee { flags } {
> if { [istarget alpha*-*-*]
> || [istarget sh*-*-*] } {
> return "$flags -mieee"
> }
> if { [istarget rx-*-*] } {
> return "$flags -mnofpu"
> }
> return $flags
> }
>
> so it’s somewhat orthogonal to whether the test is a compile or run test (the
> constraint mentioned does apply tho - some things in the dg-* processing are
> order-specific).
>
Thanks for explaining a bit of the dejagnu magic. It looks like
someone broke the testing. Here's the diff that added the ieee
options.
diff --git a/gcc/testsuite/gfortran.dg/bessel_6.f90
b/gcc/testsuite/gfortran.dg/bessel_6.f90
index
bfbf1e1fe0a072d15fbc70a2bff6cc57b77e92c4..eca92cbd756dcfdc894917260bc43679c1d842a3
100644 (file)
--- a/gcc/testsuite/gfortran.dg/bessel_6.f90
+++ b/gcc/testsuite/gfortran.dg/bessel_6.f90
@@ -1,4 +1,5 @@
! { dg-do run { xfail spu-*-* } }
+! { dg-add-options ieee }
!
! PR fortran/36158
! PR fortran/33197
Notice the presences of a ' { dg-do run }' line. Here's the
guilty commit.
diff --git a/gcc/testsuite/gfortran.dg/bessel_6.f90
b/gcc/testsuite/gfortran.dg/bessel_6.f90
index
e2336a2b4a049e62f0c89209f0399b1d49773603..07ce13c6da128f02f0895d43cd2e713fb7930470
100644 (file)
--- a/gcc/testsuite/gfortran.dg/bessel_6.f90
+++ b/gcc/testsuite/gfortran.dg/bessel_6.f90
@@ -1,12 +1,8 @@
-! { dg-do run { xfail spu-*-* } }
! { dg-add-options ieee }
!
! PR fortran/36158
! PR fortran/33197
!
-! XFAILed for SPU targets since we don't have an accurate library
-! implementation of the single-precision Bessel functions.
-!
! Run-time tests for transformations BESSEL_JN
!
This remves the running of the test. This appears to be massive
change to the testsuite, and like broke numerous testcase. Indeed,
a quick check shows
diff --git a/gcc/testsuite/gfortran.dg/erf_2.F90
b/gcc/testsuite/gfortran.dg/erf_2.F90
index
e9fd99aa05d08e49b93947b07abeaad776dd7d8b..87c99a9d5c04e540eb0a50d066afdb8bcba164b2
100644 (file)
--- a/gcc/testsuite/gfortran.dg/erf_2.F90
+++ b/gcc/testsuite/gfortran.dg/erf_2.F90
@@ -1,10 +1,6 @@
-! { dg-do run { xfail spu-*-* } }
! { dg-options "-fno-range-check -ffree-line-length-none -O0" }
! { dg-add-options ieee }
!
-! XFAILed for SPU targets because our library implementation of
-! the double-precision erf/erfc functions is not accurate enough.
-!
! Check that simplification functions and runtime library agree on ERF,
! ERFC and ERFC_SCALED.
--
Steve