testsuite: Support filtering targets by TCL procedure in `run_dump_test'
Implement a more complex way of selecting targets to include or exclude with `run_dump_test' cases, by extending the syntax for the `target', `not-target', `skip' and `not-skip' options (with the binutils and GAS test suites) and the `target', `alltargets' and `notarget' options (with the LD test suite) to also accept a name of a TCL procedure instead of a target triplet glob matching expression. The result, 1 or 0, of the procedure determines whether the test is to be run or not. This mimics and expands `dg-require-effective-target' from the GCC test suite. Names of TCL procedures are supplied in square brackets `[]' as with TCL procedure calls, observing that target triplet glob matching expressions do not normally start and end with matching square brackets both at a time. Arguments for procedures are allowed if required. Having a way to specify a complex condition for a `run_dump_test' case to run has the advantage of keeping it local within the test case itself where tool options related to the check might be also present, removing the need to wrap `run_dump_test' calls into an `if' block whose only reason is to do a feature check, and ultimately lets one have the test reported as UNSUPPORTED automagically if required (not currently supported by the `run_dump_test' options used for LD). binutils/ * testsuite/lib/binutils-common.exp (match_target): New procedure. * testsuite/lib/utils-lib.exp (run_dump_test): Use it in place of `istarget' for matching with `target', `not-target', `skip' and `not-skip' options. gas/ * testsuite/lib/gas-defs.exp (run_dump_test): Use `match_target' in place of `istarget' for matching with `target', `not-target', `skip' and `not-skip' options. ld/ * testsuite/lib/ld-lib.exp (run_dump_test): Use `match_target' in place of `istarget' for matching with `target', `alltargets' and `notarget' options.
This commit is contained in:
parent
aa17843739
commit
6d9dabbbc6
7 changed files with 89 additions and 44 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2018-04-27 Maciej W. Rozycki <macro@mips.com>
|
||||||
|
|
||||||
|
* testsuite/lib/binutils-common.exp (match_target): New procedure.
|
||||||
|
* testsuite/lib/utils-lib.exp (run_dump_test): Use it in place
|
||||||
|
of `istarget' for matching with `target', `not-target', `skip'
|
||||||
|
and `not-skip' options.
|
||||||
|
|
||||||
2018-04-26 Nick Clifton <nickc@redhat.com>
|
2018-04-26 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* readelf.c (is_32bit_abs_reloc): Support R_PARISC_DIR32 as a
|
* readelf.c (is_32bit_abs_reloc): Support R_PARISC_DIR32 as a
|
||||||
|
|
|
@ -127,6 +127,17 @@ proc is_elf64 { binary_file } {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# True if the target matches TARGET, specified as a TCL procedure if
|
||||||
|
# in square brackets or as machine triplet otherwise.
|
||||||
|
#
|
||||||
|
proc match_target { target } {
|
||||||
|
if [string match {\[*\]} $target] {
|
||||||
|
return $target
|
||||||
|
} else {
|
||||||
|
return [istarget $target]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# True if the ELF target supports STB_GNU_UNIQUE with the ELF header's
|
# True if the ELF target supports STB_GNU_UNIQUE with the ELF header's
|
||||||
# OSABI field set to ELFOSABI_GNU.
|
# OSABI field set to ELFOSABI_GNU.
|
||||||
#
|
#
|
||||||
|
|
|
@ -224,20 +224,24 @@ proc exe_ext {} {
|
||||||
# is useful if several .d files differ by options only. Options are
|
# is useful if several .d files differ by options only. Options are
|
||||||
# always read from FILE.d.
|
# always read from FILE.d.
|
||||||
#
|
#
|
||||||
# target: GLOBS...
|
# target: GLOB|PROC ...
|
||||||
# Run this test only on a specified list of targets. More precisely,
|
# Run this test only on a specified list of targets. More precisely,
|
||||||
# each glob in the space-separated list is passed to "istarget"; if
|
# in the space-separated list each glob is passed to "istarget" and
|
||||||
# it evaluates true for any of them, the test will be run, otherwise
|
# each proc is called as a TCL procedure. List items are interpreted
|
||||||
# it will be marked unsupported.
|
# such that procs are denoted by surrounding square brackets, and any
|
||||||
|
# other items are consired globs. If the call evaluates true for any
|
||||||
|
# of them, the test will be run, otherwise it will be marked
|
||||||
|
# unsupported.
|
||||||
#
|
#
|
||||||
# not-target: GLOBS...
|
# not-target: GLOB|PROC ...
|
||||||
# Do not run this test on a specified list of targets. Again,
|
# Do not run this test on a specified list of targets. Again, each
|
||||||
# the each glob in the space-separated list is passed to
|
# glob in the space-separated list is passed to "istarget" and each
|
||||||
# "istarget", and the test is run if it evaluates *false* for
|
# proc is called as a TCL procedure, and the test is run if it
|
||||||
# *all* of them. Otherwise it will be marked unsupported.
|
# evaluates *false* for *all* of them. Otherwise it will be marked
|
||||||
|
# unsupported.
|
||||||
#
|
#
|
||||||
# skip: GLOBS...
|
# skip: GLOB|PROC ...
|
||||||
# not-skip: GLOBS...
|
# not-skip: GLOB|PROC ...
|
||||||
# These are exactly the same as "not-target" and "target",
|
# These are exactly the same as "not-target" and "target",
|
||||||
# respectively, except that they do nothing at all if the check
|
# respectively, except that they do nothing at all if the check
|
||||||
# fails. They should only be used in groups, to construct a single
|
# fails. They should only be used in groups, to construct a single
|
||||||
|
@ -445,13 +449,13 @@ proc run_dump_test { name {extra_options {}} } {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
foreach glob $opts(skip) {
|
foreach glob $opts(skip) {
|
||||||
if {[istarget $glob]} { return }
|
if {[match_target $glob]} { return }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if { $opts(not-skip) != "" } then {
|
if { $opts(not-skip) != "" } then {
|
||||||
set skip 1
|
set skip 1
|
||||||
foreach glob $opts(not-skip) {
|
foreach glob $opts(not-skip) {
|
||||||
if {[istarget $glob]} {
|
if {[match_target $glob]} {
|
||||||
set skip 0
|
set skip 0
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -461,7 +465,7 @@ proc run_dump_test { name {extra_options {}} } {
|
||||||
if { $opts(target) != "" } then {
|
if { $opts(target) != "" } then {
|
||||||
set skip 1
|
set skip 1
|
||||||
foreach glob $opts(target) {
|
foreach glob $opts(target) {
|
||||||
if {[istarget $glob]} {
|
if {[match_target $glob]} {
|
||||||
set skip 0
|
set skip 0
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -473,7 +477,7 @@ proc run_dump_test { name {extra_options {}} } {
|
||||||
}
|
}
|
||||||
if { $opts(not-target) != "" } then {
|
if { $opts(not-target) != "" } then {
|
||||||
foreach glob $opts(not-target) {
|
foreach glob $opts(not-target) {
|
||||||
if {[istarget $glob]} {
|
if {[match_target $glob]} {
|
||||||
unsupported $testname
|
unsupported $testname
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2018-04-27 Maciej W. Rozycki <macro@mips.com>
|
||||||
|
|
||||||
|
* testsuite/lib/gas-defs.exp (run_dump_test): Use `match_target'
|
||||||
|
in place of `istarget' for matching with `target', `not-target',
|
||||||
|
`skip' and `not-skip' options.
|
||||||
|
|
||||||
2018-04-26 Nick Clifton <nickc@redhat.com>
|
2018-04-26 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
* as.c (flag_generate_build_notes): New variable.
|
* as.c (flag_generate_build_notes): New variable.
|
||||||
|
|
|
@ -383,20 +383,24 @@ proc run_dump_tests { testcases {extra_options {}} } {
|
||||||
# is useful if several .d files differ by options only. Options are
|
# is useful if several .d files differ by options only. Options are
|
||||||
# always read from FILE.d.
|
# always read from FILE.d.
|
||||||
#
|
#
|
||||||
# target: GLOBS...
|
# target: GLOB|PROC ...
|
||||||
# Run this test only on a specified list of targets. More precisely,
|
# Run this test only on a specified list of targets. More precisely,
|
||||||
# each glob in the space-separated list is passed to "istarget"; if
|
# in the space-separated list each glob is passed to "istarget" and
|
||||||
# it evaluates true for any of them, the test will be run, otherwise
|
# each proc is called as a TCL procedure. List items are interpreted
|
||||||
# it will be marked unsupported.
|
# such that procs are denoted by surrounding square brackets, and any
|
||||||
|
# other items are consired globs. If the call evaluates true for any
|
||||||
|
# of them, the test will be run, otherwise it will be marked
|
||||||
|
# unsupported.
|
||||||
#
|
#
|
||||||
# not-target: GLOBS...
|
# not-target: GLOB|PROC ...
|
||||||
# Do not run this test on a specified list of targets. Again,
|
# Do not run this test on a specified list of targets. Again, each
|
||||||
# the each glob in the space-separated list is passed to
|
# glob in the space-separated list is passed to "istarget" and each
|
||||||
# "istarget", and the test is run if it evaluates *false* for
|
# proc is called as a TCL procedure, and the test is run if it
|
||||||
# *all* of them. Otherwise it will be marked unsupported.
|
# evaluates *false* for *all* of them. Otherwise it will be marked
|
||||||
|
# unsupported.
|
||||||
#
|
#
|
||||||
# skip: GLOBS...
|
# skip: GLOB|PROC ...
|
||||||
# not-skip: GLOBS...
|
# not-skip: GLOB|PROC ...
|
||||||
# These are exactly the same as "not-target" and "target",
|
# These are exactly the same as "not-target" and "target",
|
||||||
# respectively, except that they do nothing at all if the check
|
# respectively, except that they do nothing at all if the check
|
||||||
# fails. They should only be used in groups, to construct a single
|
# fails. They should only be used in groups, to construct a single
|
||||||
|
@ -575,13 +579,13 @@ proc run_dump_test { name {extra_options {}} } {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
foreach glob $opts(skip) {
|
foreach glob $opts(skip) {
|
||||||
if {[istarget $glob]} { return }
|
if {[match_target $glob]} { return }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if { $opts(not-skip) != "" } then {
|
if { $opts(not-skip) != "" } then {
|
||||||
set skip 1
|
set skip 1
|
||||||
foreach glob $opts(not-skip) {
|
foreach glob $opts(not-skip) {
|
||||||
if {[istarget $glob]} {
|
if {[match_target $glob]} {
|
||||||
set skip 0
|
set skip 0
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -596,7 +600,7 @@ proc run_dump_test { name {extra_options {}} } {
|
||||||
}
|
}
|
||||||
set skip 1
|
set skip 1
|
||||||
foreach glob $opts(target) {
|
foreach glob $opts(target) {
|
||||||
if {[istarget $glob]} {
|
if {[match_target $glob]} {
|
||||||
set skip 0
|
set skip 0
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -608,7 +612,7 @@ proc run_dump_test { name {extra_options {}} } {
|
||||||
}
|
}
|
||||||
if { $opts(not-target) != "" } then {
|
if { $opts(not-target) != "" } then {
|
||||||
foreach glob $opts(not-target) {
|
foreach glob $opts(not-target) {
|
||||||
if {[istarget $glob]} {
|
if {[match_target $glob]} {
|
||||||
unsupported $testname
|
unsupported $testname
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2018-04-27 Maciej W. Rozycki <macro@mips.com>
|
||||||
|
|
||||||
|
* testsuite/lib/ld-lib.exp (run_dump_test): Use `match_target'
|
||||||
|
in place of `istarget' for matching with `target', `alltargets'
|
||||||
|
and `notarget' options.
|
||||||
|
|
||||||
2018-04-27 Alan Modra <amodra@gmail.com>
|
2018-04-27 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* po/BLD-POTFILES.in: Regenerate.
|
* po/BLD-POTFILES.in: Regenerate.
|
||||||
|
|
|
@ -535,19 +535,26 @@ proc ld_link_defsyms {} {
|
||||||
# once.
|
# once.
|
||||||
#
|
#
|
||||||
# target: TARGET
|
# target: TARGET
|
||||||
# Only run the test for TARGET. This may occur more than once; the
|
# Only run the test for TARGET.
|
||||||
# target being tested must match at least one. You may provide target
|
# You may provide target name "cfi" for any target supporting the
|
||||||
# name "cfi" for any target supporting the CFI statements. You may
|
# CFI statements. You may provide target name "shared" for any
|
||||||
# provide target name "shared" for any target supporting shared
|
# target supporting shared libraries. Otherwise TARGET is called
|
||||||
# libraries.
|
# as a TCL procedure if surrounded by square brackets, or passed
|
||||||
|
# to "istarget" if not.
|
||||||
|
# This may occur more than once; the target being tested must match
|
||||||
|
# at least one.
|
||||||
#
|
#
|
||||||
# alltargets: TARGET
|
# alltargets: TARGET
|
||||||
# Only run the test for TARGET. This may occur more than once; the
|
# Only run the test for TARGET.
|
||||||
# target being tested must match all of them.
|
# The syntax for TARGET is as with 'target'.
|
||||||
|
# This may occur more than once; the target being tested must match
|
||||||
|
# all of them.
|
||||||
#
|
#
|
||||||
# notarget: TARGET
|
# notarget: TARGET
|
||||||
# Do not run the test for TARGET. This may occur more than once;
|
# Do not run the test for TARGET.
|
||||||
# the target being tested must not match any of them.
|
# The syntax for TARGET is as with 'target'.
|
||||||
|
# This may occur more than once; the target being tested must not
|
||||||
|
# match any of them.
|
||||||
#
|
#
|
||||||
# error: REGEX
|
# error: REGEX
|
||||||
# An error with message matching REGEX must be emitted for the test
|
# An error with message matching REGEX must be emitted for the test
|
||||||
|
@ -743,7 +750,7 @@ proc run_dump_test { name {extra_options {}} } {
|
||||||
if { [llength $opts(target)] > 0 } {
|
if { [llength $opts(target)] > 0 } {
|
||||||
set targmatch 0
|
set targmatch 0
|
||||||
foreach targ $opts(target) {
|
foreach targ $opts(target) {
|
||||||
if [istarget $targ] {
|
if [match_target $targ] {
|
||||||
set targmatch 1
|
set targmatch 1
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -753,12 +760,12 @@ proc run_dump_test { name {extra_options {}} } {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach targ $opts(alltargets) {
|
foreach targ $opts(alltargets) {
|
||||||
if ![istarget $targ] {
|
if ![match_target $targ] {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach targ $opts(notarget) {
|
foreach targ $opts(notarget) {
|
||||||
if [istarget $targ] {
|
if [match_target $targ] {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue