This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
patch from cgd
- From: Eric Christopher <echristo at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: 19 Apr 2002 13:22:08 -0700
- Subject: patch from cgd
I need some approval on the patch that Chris came up with so that I can check
in an assembler patch that'll break his testcase as is...
-eric
===================================================================
2002-04-18 Chris Demetriou <cgd@broadcom.com>
* 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.
Index: gas/mips/empic.d
===================================================================
RCS file: /cvs/src/src/gas/testsuite/gas/mips/empic.d,v
retrieving revision 1.6
diff -u -p -r1.6 empic.d
--- gas/mips/empic.d 1 Nov 2001 01:33:47 -0000 1.6
+++ gas/mips/empic.d 18 Apr 2002 19:34:04 -0000
@@ -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.
Index: gas/mips/empic.l
===================================================================
RCS file: gas/mips/empic.l
diff -N gas/mips/empic.l
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gas/mips/empic.l 18 Apr 2002 19:34:04 -0000
@@ -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
Index: lib/gas-defs.exp
===================================================================
RCS file: /cvs/src/src/gas/testsuite/lib/gas-defs.exp,v
retrieving revision 1.6
diff -u -p -r1.6 gas-defs.exp
--- lib/gas-defs.exp 29 Aug 2001 18:11:19 -0000 1.6
+++ lib/gas-defs.exp 18 Apr 2002 19:34:05 -0000
@@ -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 } {
@@ -562,6 +583,12 @@ proc file_contents { filename } {
set contents [read $file]
close $file
return $contents
+}
+
+proc write_file { filename contents } {
+ set file [open $filename w]
+ puts $file "$contents"
+ close $file
}
proc verbose_eval { expr { level 1 } } {
--
Written using state-of-the-rat
technology.