diff options
Diffstat (limited to 'gas')
-rw-r--r-- | gas/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gas/testsuite/lib/gas-defs.exp | 26 |
2 files changed, 27 insertions, 6 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 6d9e3be..fdfc06c 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,8 +1,7 @@ -2002-12-20 DJ Delorie <dj@redhat.com> +2002-12-20 Chris Demetriou <cgd@broadcom.com> - * 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 <cgd@broadcom.com> diff --git a/gas/testsuite/lib/gas-defs.exp b/gas/testsuite/lib/gas-defs.exp index 8bc7c58..42027d6 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 |