Add dg-final option-based target selectors
authorRichard Sandiford <richard.sandiford@arm.com>
Sat, 24 Apr 2021 08:35:16 +0000 (09:35 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Sat, 24 Apr 2021 08:35:16 +0000 (09:35 +0100)
commit0d923657c2fefac8aeb8eb317fe5c7e7c55880c9
treef279b9ce648d7e5671873368ef89f7f3ce50fa87
parentbcd77b7b9f35bd5b559ed593c3b3e346c1e6f364
Add dg-final option-based target selectors

This patch adds target selectors of the form:

  { any-opts "opt1" ... "optn" }
  { no-opts "opt1" ... "optn" }

for skipping or xfailing tests based on compiler options.  It only
works for dg-final selectors.

The patch then uses no-opts to exclude -O0 and (sometimes) -Og from
some guality.exp xfails.  AFAICT (based on gcc-testresults) these
tests pass for those options for all targets.

gcc/
* doc/sourcebuild.texi: Document no-opts and any-opts target
selectors.

gcc/testsuite/
* lib/target-supports-dg.exp (selector_expression): Handle any-opts
and no-opts.
* gcc.dg/guality/pr41353-1.c: Exclude -O0 from xfail.
* gcc.dg/guality/pr59776.c: Likewise.
* gcc.dg/guality/pr54970.c: Likewise -O0 and -Og.
gcc/doc/sourcebuild.texi
gcc/testsuite/gcc.dg/guality/pr41353-1.c
gcc/testsuite/gcc.dg/guality/pr54970.c
gcc/testsuite/gcc.dg/guality/pr59776.c
gcc/testsuite/lib/target-supports-dg.exp