This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 6/9] MIPS/GAS: Add support for architecture test overrides


Hi,

 This is a change to add support for architecture-specific test overrides.  
It makes the test harness check for the existence of an 
architecture-specific template first before resorting to the default one.  
It makes it easy to construct tests that cover a range of architectures 
for which different output is generated, yet only a single line to request 
the test is needed in mips.exp.  The desired effect is to avoid 
architectures to be left uncovered either by accident or because they 
would require explicit invocations to be placed in mips.exp.

 The main use of this addition is to permit rerunning of as many existing 
tests as possible for the microMIPS ASE that strives to be 
source-compatible with standard MIPS code, but it can be used for other 
architecture variations as well, e.g. MIPS I load-delay slots, etc.

 In a somewhat twisted scenario, the template can also override the source 
file used; this is actually a useful feature as this way test case 
invocations can serve the purpose of defining a point of testing a given 
functionality rather than strictly the same set of assembly instructions.  
I have actually made use of this property with some microMIPS bits.

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

	gas/testsuite/
	* gas/mips/mips.exp (run_dump_test_arch): Check for the presence
	of an architecture-specific test first and use it if found,
	before falling back to the generic one.

 OK to commit?

  Maciej

binutils-252306.diff
Index: binutils-fsf-trunk-quilt/gas/testsuite/gas/mips/mips.exp
===================================================================
--- binutils-fsf-trunk-quilt.orig/gas/testsuite/gas/mips/mips.exp	2010-06-30 14:28:37.000000000 +0100
+++ binutils-fsf-trunk-quilt/gas/testsuite/gas/mips/mips.exp	2010-06-30 14:39:27.000000000 +0100
@@ -271,7 +271,12 @@
 # Invoke "run_dump_test" for test NAME, with extra assembler and
 # disassembler flags to test architecture ARCH.
 proc run_dump_test_arch { name arch } {
-    global subdir
+    global subdir srcdir
+
+    set archname "${arch}@${name}"
+    if { [file exists "$srcdir/$subdir/${archname}.d"] } {
+	set name $archname
+    }
 
     if [catch {run_dump_test $name \
 			     "{name    {([mips_arch_displayname $arch])}}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]