This is the mail archive of the gcc-patches@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: [testsuite] (committed) provide access to flags for current test


On Wed, 2009-01-07 at 11:39 -0800, H.J. Lu wrote:
> On Wed, Jan 7, 2009 at 10:34 AM, Janis Johnson <janis187@us.ibm.com> wrote:
> > This patch consolidates read accesses of dg-test local variables
> > dg-extra-tool-flags (set from default flags or dg-options) and
> > tool_flags (set from torture options) so that not as many procedures in
> > lib/target-supports-dg.exp need to use upvar to get to them.  More
> > importantly, it makes those options available to more places in the
> > testsuite framework, such as for effective-target keywords that don't
> > cache their results.  Furthermore, the places that need access to the
> > current test options don't need to know how may stack frames they are
> > away from dg-test.
> >
> > The patch was written in response to requests from Joel Sherrill, who
> > wants a way to skip a test if the options passed by dg-options are
> > overridden by flags from the target board or by options passed via
> > RUNTESTFLAGS.  Richard Sandiford recently reorganized gcc.target/mips to
> > solve the problem in a different way, which is more elegant but also
> > more work.
> >
> > Tested by running all tests for all languages but Ada on powerpc64-linux
> > with -m32/-m64, and running gcc.test-framework.  Checked in on mainline.
> >
> >
> 
> Hi Janis,
> 
> Is there a way to preppend extra options to CFLAGS for a target board?
> Right now, I have
> 
> set_board_info cflags "-mavx -Wa,-msse-check=error"
> 
> It appends "-mavx -Wa,-msse-check=error" to CFLAGS and overrides
> -mXXX specified in the tests. I'd like to avoid it.

Flags defined in CFLAGS_FOR_TARGET are at the beginning of the command
line options for GCC tests.  You can add a line at the end of file
gcc/site.exp in the build directory defining it, e.g.

  set CFLAGS_FOR_TARGET "-g"

Those are followed by torture options, defaults for the .exp or else
dg-options, and multilib flags, with some other board info flags in
between.

Take a look at Richard Sandiford's support in gcc.target/mips for
amazing ways to handle options for a particular architecture.

Janis


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