[PATCH 1/4] GAS: Permit the reuse of dump patterns

Maciej W. Rozycki macro@codesourcery.com
Tue Jul 20 11:43:00 GMT 2010
Hi,

 This is a change to add support for the "dump" option to run_dump_test().  
This lets one specify an alternative .d file providing regexp patterns for 
the test output to match against, typically another .d file that differs 
by the options used only.  Options for the current test are retrieved from 
${file}.d as usually, which is also the default when no "dump" has been 
specified.  This is useful in multi-arch testing, saving the need to keep 
an exact copy of the patterns used for each subarchitecture and to update 
all of them whenever anything changes.

2010-07-20  Maciej W. Rozycki  <macro@codesourcery.com>

	gas/testsuite/
	* lib/gas-defs.exp (run_dump_test): Handle the "dump" option.

 OK to apply?

  Maciej

binutils-gas-dump.diff
Index: binutils-fsf-trunk-quilt/gas/testsuite/lib/gas-defs.exp
===================================================================
--- binutils-fsf-trunk-quilt.orig/gas/testsuite/lib/gas-defs.exp	2010-07-14 01:35:03.000000000 +0100
+++ binutils-fsf-trunk-quilt/gas/testsuite/lib/gas-defs.exp	2010-07-14 01:35:11.000000000 +0100
@@ -417,6 +417,11 @@
 #	Assemble the file SOURCE.s.  If omitted, this defaults to FILE.s.
 #       This is useful if several .d files want to share a .s file.
 #
+#   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.
+#
 #   target: GLOBS...
 #       Run this test only on a specified list of targets.  More precisely,
 #       each glob in the space-separated list is passed to "istarget"; if
@@ -491,6 +496,7 @@
     set opts(name) {}
     set opts(PROG) {}
     set opts(source) {}
+    set opts(dump) {}
     set opts(stderr) {}
     set opts(error) {}
     set opts(error-output) {}
@@ -648,6 +654,12 @@
 	set sourcefile $srcdir/$subdir/$opts(source)
     }
 
+    if { $opts(dump) == "" } {
+	set dumpfile ${file}.d
+    } else {
+	set dumpfile $srcdir/$subdir/$opts(dump)
+    }
+
     set cmd "$AS $ASFLAGS $opts(as) -o dump.o $sourcefile"
     send_log "$cmd\n"
     set status [gas_host_run $cmd ""]
@@ -769,7 +781,7 @@
     }
 
     verbose_eval {[file_contents "dump.out"]} 3
-    if { [regexp_diff "dump.out" "${file}.d"] } then {
+    if { [regexp_diff "dump.out" "${dumpfile}"] } then {
 	fail $testname
 	verbose "output is [file_contents "dump.out"]" 2
 	return



More information about the Binutils mailing list