* gas/mips/mips.exp (run_dump_test_arch): Check for the presence
authorMaciej W. Rozycki <macro@linux-mips.org>
Sun, 24 Oct 2010 09:59:20 +0000 (09:59 +0000)
committerMaciej W. Rozycki <macro@linux-mips.org>
Sun, 24 Oct 2010 09:59:20 +0000 (09:59 +0000)
of a file-format-specific test too.
(run_dump_test_arches): Pull elf, ecoff and aout variables for
use by the above.

gas/testsuite/ChangeLog
gas/testsuite/gas/mips/mips.exp

index 1f467051716c7035a1994a886333506db3735617..286fce9711c2d59af456c78baea06b0b939f2c04 100644 (file)
@@ -1,3 +1,11 @@
+2010-10-24  Maciej W. Rozycki  <macro@linux-mips.org>
+            Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * gas/mips/mips.exp (run_dump_test_arch): Check for the presence
+       of a file-format-specific test too.
+       (run_dump_test_arches): Pull elf, ecoff and aout variables for
+       use by the above.
+
 2010-10-24  Maciej W. Rozycki  <macro@linux-mips.org>
 
        * gas/mips/ld.s: Remove "l.d", "s.d" and "sd" instructions.
index f581c9d6f63a6dcb7e8fd967636928f7b058c791..8c04254588c501b507c46347b88bfd8a75cd642b 100644 (file)
@@ -286,13 +286,30 @@ proc mips_arch_list_matching {args} {
 #
 # Invoke "run_dump_test" for test NAME, with extra assembler and
 # disassembler flags to test architecture ARCH.
+#
+# You can override the expected output for particular architectures
+# and file formats.  The possible test names are, in order of preference:
+#
+# 1. CARCH@FORMAT@NAME.d
+# 2. CARCH@NAME.d
+# 3. FORMAT@NAME.d
+# 4. NAME.d
+#
+# where CARCH is the "canonical" name of architecture ARCH as recorded
+# in its associated property list, and where FORMAT is the target's
+# file format (one of "elf", "ecoff" or "aout").
 proc run_dump_test_arch { name arch } {
+    upvar elf elf ecoff ecoff aout aout
     global subdir srcdir
 
+    set format [expr { $elf ? "elf" : $ecoff ? "ecoff" : "aout" }]
     set proparch [lindex [mips_arch_properties $arch 0] 0]
-    set archname "${proparch}@${name}"
-    if { [file exists "$srcdir/$subdir/${archname}.d"] } {
-       set name $archname
+    foreach prefix [list ${proparch}@${format}@ ${proparch}@ ${format}@] {
+       set archname ${prefix}${name}
+       if { [file exists "$srcdir/$subdir/${archname}.d"] } {
+           set name $archname
+           break
+       }
     }
 
     if [catch {run_dump_test $name \
@@ -309,6 +326,7 @@ proc run_dump_test_arch { name arch } {
 # Invoke "run_dump_test_arch" for test NAME, for each architecture
 # listed in ARCH_LIST.
 proc run_dump_test_arches { name arch_list } {
+    upvar elf elf ecoff ecoff aout aout
     foreach arch $arch_list {
        run_dump_test_arch "$name" "$arch"
     }
This page took 0.030296 seconds and 4 git commands to generate.