From: Chris Demetriou Date: Mon, 22 Apr 2002 21:14:43 +0000 (+0000) Subject: 2002-04-22 Chris Demetriou X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ff970196bd5561eb16b271a0947ea1919186c377;p=binutils-gdb.git 2002-04-22 Chris Demetriou * lib/gas-defs.exp (run_dump_test): Support new attribute "stderr" which is a file used to regexp_diff the assembler's pruned stderr output. (write_file): New helper function to write a string into a file. * gas/mips/empic.l: New file which matches empic tests' warnings. * gas/mips/empic.d: Use empic.l. --- diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 8cffe68b17e..6299e5b8b92 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2002-04-22 Chris Demetriou + + * lib/gas-defs.exp (run_dump_test): Support new attribute "stderr" + which is a file used to regexp_diff the assembler's pruned stderr + output. + (write_file): New helper function to write a string into a file. + + * gas/mips/empic.l: New file which matches empic tests' warnings. + * gas/mips/empic.d: Use empic.l. + 2002-04-19 Nick Clifton * gas/all/gas.exp (cofftag): Do not run test for xscale-coff diff --git a/gas/testsuite/gas/mips/empic.d b/gas/testsuite/gas/mips/empic.d index b74da310687..e6886d0d94e 100644 --- a/gas/testsuite/gas/mips/empic.d +++ b/gas/testsuite/gas/mips/empic.d @@ -1,6 +1,7 @@ #objdump: -rst -mmips:4000 #name: MIPS empic #as: -membedded-pic -mips3 +#stderr: empic.l # Check GNU-specific embedded relocs, for ELF. diff --git a/gas/testsuite/gas/mips/empic.l b/gas/testsuite/gas/mips/empic.l new file mode 100644 index 00000000000..e53d4f230e2 --- /dev/null +++ b/gas/testsuite/gas/mips/empic.l @@ -0,0 +1,3 @@ +.*: Assembler messages: +.*:42: Warning: Macro instruction expanded into multiple instructions in a branch delay slot +.*:56: Warning: Macro instruction expanded into multiple instructions in a branch delay slot diff --git a/gas/testsuite/lib/gas-defs.exp b/gas/testsuite/lib/gas-defs.exp index e695abf7cb6..777c0e17f31 100644 --- a/gas/testsuite/lib/gas-defs.exp +++ b/gas/testsuite/lib/gas-defs.exp @@ -266,6 +266,7 @@ proc run_dump_test { name } { set opts(name) {} set opts(PROG) {} set opts(source) {} + set opts(stderr) {} foreach i $opt_array { set opt_name [lindex $i 0] @@ -339,10 +340,30 @@ proc run_dump_test { name } { set comp_output [prune_warnings $comp_output] if ![string match "" $comp_output] then { - send_log "$comp_output\n" - verbose "$comp_output" 3 - fail $testname - return + if { $opts(stderr) == "" } then { + send_log "$comp_output\n" + verbose "$comp_output" 3 + fail $testname + return + } else { + catch {write_file dump.stderr "$comp_output"} write_output + if ![string match "" $write_output] then { + send_log "error writing dump.stderr: $write_output\n" + verbose "error writing dump.stderr: $write_output" 3 + send_log "$comp_output\n" + verbose "$comp_output" 3 + fail $testname + return + } + set stderrfile $srcdir/$subdir/$opts(stderr) + send_log "wrote pruned stderr to dump.stderr\n" + verbose "wrote pruned stderr to dump.stderr" 3 + if { [regexp_diff "dump.stderr" "$stderrfile"] } then { + fail $testname + verbose "pruned stderr is [file_contents "dump.stderr"]" 2 + return + } + } } if { [which $binary] == 0 } { @@ -564,6 +585,12 @@ proc file_contents { filename } { return $contents } +proc write_file { filename contents } { + set file [open $filename w] + puts $file "$contents" + close $file +} + proc verbose_eval { expr { level 1 } } { global verbose if $verbose>$level then { eval verbose "$expr" $level }