From 8b7955ca9bc1ae723b7c9f1b5a31ccfa24608911 Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Sun, 24 Oct 2010 09:59:20 +0000 Subject: [PATCH] * 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. --- gas/testsuite/ChangeLog | 8 ++++++++ gas/testsuite/gas/mips/mips.exp | 24 +++++++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 1f467051716..286fce9711c 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2010-10-24 Maciej W. Rozycki + Richard Sandiford + + * 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 * gas/mips/ld.s: Remove "l.d", "s.d" and "sd" instructions. diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp index f581c9d6f63..8c04254588c 100644 --- a/gas/testsuite/gas/mips/mips.exp +++ b/gas/testsuite/gas/mips/mips.exp @@ -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" } -- 2.30.2