Occasionally I try to run GCC tests using flags for which I don't have
the required target platform, or even compatible libraries.  I usually
hack up several test files to kind of get what I want, but it's a pain.
Right now, for example, I'm trying to run upstream gcc.target/arm tests
for several sets of options that are not supported in my test
environment for upstream tools.  There are probably lots of others in
the same situation, so I'd like to make this easier for all of us.

It's easy to skip test execution by using a do-nothing $tool_load
procedure in the board file, but would also be fairly easy to skip it by
checking for a flag in a few places in GCC's DejaGNU support.  The
advantage of checking for a flag is that it could be set for the board,
or globally, or for an individual test with something like

  { dg-skip-run-if comment { selector } [{ include-opts } [{ exclude-opts }]] }

This would allow the equivalent of "dg-do run" for some effective
targets and "dg-do link" for others.  (There are a couple of tests that
currently have two "dg-do" directives with different keywords for
different selectors, but that doesn't do what the test authors intended.)

Another possibility is to specify globally, or for a board, or for an
individual test, the highest level of dg-do keyword to support, ordered
{ preprocess, compile, link, run }.  Perhaps within a test this would be
done with

  { dg-do run }
  { dg-do-link-if comment { selector } [{ include-opts } [{ exclude-opts }]] }
  { dg-do-compile-if comment { selector } [{ include-opts } [{ exclude-opts }]] 
}

where the dg-do-*-if directives would only be used if the test would
otherwise use a later step.  This would need to be tied in with uses of
dg-do-what-default for several sets of tests.

Do other people have ideas for downgrading how much work is done in a
test, or have local solutions?

Janis

Reply via email to