From ef2b5578f693bc6caa0d6c750bd32aaf10dee727 Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Mon, 6 Aug 2012 21:05:54 +0000 Subject: gas/testsuite/ * gas/mips/mips.exp: Set has_newabi for mips*-sde-elf* too. * gas/mips/elf-rel-got-n32.s: Adjust padding. * gas/mips/elf-rel-got-n64.s: Likewise. * gas/mips/elf-rel23.s: Likewise. * gas/mips/elf-rel28.s: Likewise. * gas/mips/n32-consec.s: Likewise. * gas/mips/elf-rel-xgot-n32.d: Adjust output expected. * gas/mips/elf-rel-xgot-n64.d: Likewise. * gas/mips/elf-rel23.d: Likewise. * gas/mips/elf-rel23a.d: Likewise. * gas/mips/elf-rel23b.d: Likewise. * gas/mips/elf-rel28-n32.d: Likewise. ld/testsuite/ * lib/ld-lib.exp (run_dump_test): Implement the EXTRA_OPTIONS argument and the "dump" keyword. * ld-mips-elf/emit-relocs-1a.s: Make section alignment uniform across targets. * ld-mips-elf/emit-relocs-1b.s: Likewise. * ld-mips-elf/jalbal.s: Adjust padding. * ld-mips-elf/elf-rel-got-n32-embed.d: New test. * ld-mips-elf/elf-rel-got-n64-embed.d: New test. * ld-mips-elf/elf-rel-xgot-n32-embed.d: New test. * ld-mips-elf/elf-rel-xgot-n64-embed.d: New test. * ld-mips-elf/elf-rel-got-n32.d: Remove -melf32btsmipn32. * ld-mips-elf/elf-rel-got-n64.d: Remove -melf64btsmip. Adjust output. * ld-mips-elf/elf-rel-got-n64-linux.d: Remove -melf64btsmip. * ld-mips-elf/elf-rel-xgot-n32.d: Remove -melf32btsmipn32. Adjust output. * ld-mips-elf/elf-rel-xgot-n64.d: Remove -melf64btsmip. Adjust output. * ld-mips-elf/elf-rel-xgot-n64-linux.d: Likewise. * ld-mips-elf/reloc-1-n64.d: Remove -melf64btsmip. * ld-mips-elf/mips-elf.exp: Set has_newabi for mips*-sde-elf* too. Move tool flags from o32_as_flags and o32_ld_flags variables into abi_asflags and abi_ldflags arrays. Adjust test cases run to use them. Run the new tests. --- ld/testsuite/lib/ld-lib.exp | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) (limited to 'ld/testsuite/lib') diff --git a/ld/testsuite/lib/ld-lib.exp b/ld/testsuite/lib/ld-lib.exp index de0f7ad..0444a38 100644 --- a/ld/testsuite/lib/ld-lib.exp +++ b/ld/testsuite/lib/ld-lib.exp @@ -436,7 +436,7 @@ proc ld_simple_link_defsyms {} { return $flags } -# run_dump_test FILE +# run_dump_test FILE (optional:) EXTRA_OPTIONS # Copied from gas testsuite, tweaked and further extended. # # Assemble a .s file, then run some utility on it and check the output. @@ -461,6 +461,12 @@ proc ld_simple_link_defsyms {} { # 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 @@ -508,6 +514,11 @@ proc ld_simple_link_defsyms {} { # More than one "source" directive can be given, which is useful # when testing linking. # +# dump: DUMP +# Match against DUMP.d. If omitted, this defaults to FILE.d. This +# is useful if several .d files differ by options only. Options are +# always read from FILE.d. +# # xfail: TARGET # The test is expected to fail on TARGET. This may occur more than # once. @@ -539,7 +550,7 @@ proc ld_simple_link_defsyms {} { # regexps in FILE.d. `regexp_diff' is defined in binutils-common.exp; # 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 LD global OBJDUMPFLAGS NMFLAGS ASFLAGS OBJCOPYFLAGS READELFFLAGS LDFLAGS @@ -579,6 +590,7 @@ proc run_dump_test { name } { set opts(name) {} set opts(PROG) {} set opts(source) {} + set opts(dump) {} set opts(error) {} set opts(warning) {} set opts(objcopy_linked_file) {} @@ -641,6 +653,24 @@ proc run_dump_test { name } { } } } + + 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 { ![regexp "warning|error" $opt_name] + && [string length $opts($opt_name)] } { + append opts($opt_name) " " + } + append opts($opt_name) $opt_val + } + foreach opt { as ld } { regsub {\[big_or_little_endian\]} $opts($opt) \ [big_or_little_endian] opts($opt) @@ -721,6 +751,12 @@ proc run_dump_test { name } { } } + if { $opts(dump) == "" } { + set dfile ${file}.d + } else { + set dfile $srcdir/$subdir/$opts(dump) + } + # Time to setup xfailures. foreach targ $opts(xfail) { setup_xfail $targ @@ -876,7 +912,7 @@ proc run_dump_test { name } { } if { $verbose > 2 } then { verbose "output is [file_contents $dumpfile]" 3 } - if { [regexp_diff $dumpfile "${file}.d"] } then { + if { [regexp_diff $dumpfile "${dfile}"] } then { fail $testname if { $verbose == 2 } then { verbose "output is [file_contents $dumpfile]" 2 } return -- cgit v1.1