This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: dg-add-options ieee ?


On Wed, Oct 31, 2018 at 02:20:38PM -0400, Paul Koning wrote:
> I see some test cases that say dg-add-options ieee.  That apparently means: pretend we have IEEE float even when the target does not.

It means:

(from testsuite/lib/target-supports.exp)

===
# 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
}
===

i.e. add those options that make the floating point IEEE compliant.
If your target cannot do that, it should skip the tests that need IEEE float
(and if it can do it, but it is (possibly) not the default, code needs to
be added here for your target).

> What is the point of doing that?  On non-IEEE targets such test cases fail -- at least they do on pdp11.  Instead I'd expect a check that skips these tests if not IEEE.  There is a subdirectory for IEEE tests under gcc.c-torture, though not under gcc.dg.
> 
> I can just put a target specific dg-skip-if in these files, but I'm curious why dg-add-options was used.

On some targets IEEE float is not the default, but those targets can still
do it if you pass certain options.


Segher


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]