This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: dg-skip-if on powerpc when multiple cpu cflags specified
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- Cc: "janis187 at us dot ibm dot com" <janis187 at us dot ibm dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Mon, 28 Apr 2008 07:47:41 -0700
- Subject: Re: dg-skip-if on powerpc when multiple cpu cflags specified
- References: <47D7F58E.2000602@oarcorp.com> <20080312170329.GA29540@lucon.org> <47D812A9.5010001@oarcorp.com> <200803121740.52085.paul@codesourcery.com> <47D81952.6050000@oarcorp.com> <200803121807.m2CI7Hrd033536@makai.watson.ibm.com> <47D81E77.8070603@oarcorp.com> <200803121823.m2CINW5g029444@makai.watson.ibm.com> <47D82BF8.8070908@oarcorp.com> <200803121922.m2CJMm1A031242@makai.watson.ibm.com> <Pine.LNX.4.64.0803121945250.29332@digraph.polyomino.org.uk> <47D9844B.2000905@oarcorp.com> <Pine.LNX.4.64.0803140041540.12948@digraph.polyomino.org.uk> <47DA974C.5030708@oarcorp.com> <1205515315.10653.8.camel@janis-laptop> <1205517268.10653.12.camel@janis-laptop> <480F5C27.5000508@oarcorp.com> <1209076807.12614.23.camel@janis-laptop> <48110FA0.6000706@oarcorp.com> <1209078471.12614.30.camel@janis-laptop> <48111449.80301@oarcorp.com> <1209080500.12614.41.camel@janis-laptop> <4814F122.6040709@codesourcery.com> <4815D730.5080408@oarcorp.com>
Joel Sherrill wrote:
1. Make these tests say something about what capability they require,
with a dg-require directive, and then write autoconf-style tests run by
the testsuite to determine whether the current compiler has that
capability. For example, add a "dg-require-hard-float" directive, and
probe the compiler to see whether it can generate hard float, given all
the options in play.
That will not work on at least the *-rtems* configurations.
We use one multilib'ed toolset configuration to support
all variants within a family. So for the PowerPC, we actually
do have support for [4567]xx, [58]xxx, etc. m68k includes
coldfire, etc.
There's no reason that we can't probe once per multilib. There are
already probes like that in the testsuite. The autoconfy-ness just
needs to be per-multilib.
I think this would work. If you ended up with compiler
settings that didn't match what the test required, then
it could exit. How should it exit in this case?
Just by doing "return 0;" from "main".
For the case we have been looking at, -mcpu=405 results
in __PPC405__ being defined. If you are writing a CPU model
specific test, you should know what the macro generated is.
#if !defined(__PPC405__)
XXX -- ?? what to do?
#endif
Here:
#if !defined(__PPC405__)
int main() { return 0; }
#else
/* The real test goes here. */
#endif
Would this work on the scan tests which look for particular
assembly instructions?
Probably not. Though, I suppose:
#if !defined(__PPC405__)
asm("haha here is a 405 insn");
#else
/* The real test goes here. */
#endif
might...
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713