From: Chris Demetriou Date: Sat, 21 Dec 2002 02:50:46 +0000 (+0000) Subject: 2002-12-20 Chris Demetriou X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e8119602a5647be2501acd716b04dc0556ca7d85;p=binutils-gdb.git 2002-12-20 Chris Demetriou * lib/gas-defs.exp (run_dump_test): Add a new optional argument, "extra_options". --- diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 6d9e3be42b5..fdfc06c18de 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,8 +1,7 @@ -2002-12-20 DJ Delorie +2002-12-20 Chris Demetriou - * gas/xstormy16/allinsn.sh: Add tests for 12-bit reloc. - * gas/xstormy16/allinsn.s: Likewise. - * gas/xstormy16/allinsn.d: Likewise. + * lib/gas-defs.exp (run_dump_test): Add a new optional argument, + "extra_options". 2002-12-18 Chris Demetriou diff --git a/gas/testsuite/lib/gas-defs.exp b/gas/testsuite/lib/gas-defs.exp index 8bc7c580022..42027d60cab 100644 --- a/gas/testsuite/lib/gas-defs.exp +++ b/gas/testsuite/lib/gas-defs.exp @@ -183,7 +183,7 @@ proc gas_init { args } { } -# run_dump_test FILE +# run_dump_test FILE (optional:) EXTRA_OPTIONS # # Assemble a .s file, then run some utility on it and check the output. # @@ -207,6 +207,12 @@ proc gas_init { args } { # list ends with the first line that doesn't match the above syntax # (hmm, not great for error detection). # +# The optional EXTRA_OPTIONS argument to `run_dump_test' is a list of +# two-element lists. The first element of each is an option name, and +# the second additional arguments to be added on to the end of the +# option list as given in FILE.d. (If omitted, no additional options +# are added.) +# # The interesting options are: # # name: TEST-NAME @@ -247,7 +253,7 @@ proc gas_init { args } { # regexps in FILE.d. `regexp_diff' is defined later in this file; see # further comments there. -proc run_dump_test { name } { +proc run_dump_test { name {extra_options {}} } { global subdir srcdir global OBJDUMP NM AS OBJCOPY READELF global OBJDUMPFLAGS NMFLAGS ASFLAGS OBJCOPYFLAGS READELFFLAGS @@ -293,6 +299,22 @@ proc run_dump_test { name } { set opts($opt_name) $opt_val } + foreach i $extra_options { + set opt_name [lindex $i 0] + set opt_val [lindex $i 1] + if ![info exists opts($opt_name)] { + perror "unknown option $opt_name given in extra_opts" + unresolved $subdir/$name + return + } + # add extra option to end of existing option, adding space + # if necessary. + if [string length $opts($opt_name)] { + append opts($opt_name) " " + } + append opts($opt_name) $opt_val + } + if {$opts(PROG) != ""} { switch -- $opts(PROG) { objdump