]> git.ipfire.org Git - thirdparty/gcc.git/commit
testsuite: Allow general skips/requires in PCH tests
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 26 Oct 2023 15:35:47 +0000 (16:35 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 26 Oct 2023 15:35:47 +0000 (16:35 +0100)
commit8a0fceee462ee2365e75d6c6014b512704f49c69
tree94d18fb0ac50279a34060128914b817427860169
parent7006e5d2d7b5b2f38c84a5edd701f154ce18a230
testsuite: Allow general skips/requires in PCH tests

dg-pch.exp handled dg-require-effective-target pch_supported_debug
as a special case, by grepping the source code.  This patch tries
to generalise it to other dg-require-effective-targets, and to
dg-skip-if.

There also seemed to be some errors in check-flags.  It used:

    lappend $args [list <elt>]

which treats the contents of args as a variable name.  I think
it was supposed to be "lappend args" instead.  From the later
code, the element was supposed to be <elt> itself, rather than
a singleton list containing <elt>.

We can also save some time by doing the common early-exit first.

Doing this removes the need to specify the dg-require-effective-target
in both files.  Tested by faking unsupported debug and checking that
the tests were still correctly skipped.

gcc/testsuite/
* lib/target-supports-dg.exp (check-flags): Move default argument
handling further up.  Fix a couple of issues in the lappends.
Avoid frobbing the compiler flags if the return value is already
known to be 1.
* lib/dg-pch.exp (dg-flags-pch): Process the dg-skip-if and
dg-require-effective-target directives to see whether the
assembly test should be skipped.
* gcc.dg/pch/valid-1.c: Remove dg-require-effective-target.
* gcc.dg/pch/valid-1b.c: Likewise.
gcc/testsuite/gcc.dg/pch/valid-1.c
gcc/testsuite/gcc.dg/pch/valid-1b.c
gcc/testsuite/lib/dg-pch.exp
gcc/testsuite/lib/target-supports-dg.exp