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]

Re: [Patch] Fix some gas FAILures on mips64


David Daney <david.daney@cavium.com> writes:
> On mips64-linux-gnu we were seeing the gas mips4-fp and mips5-fp tests 
> fail when run for the mips32r2 architecture.  This was happening because 
> the default ABI for the assembler was 64 bits, but mips32r2 only 
> supports 32 bit ABIs.
>
> The fix is to duplicate the .d files for these tests for mips32r2, and 
> supply -32 to gas to get the proper ABI.

Yeah, that's probably the right fix as things stand.  I'm getting increasing
worried about the proliferation of dump files though, so I prefer the attached.
It makes run_dump_test_arches take an additional set of assembler options
that should be used for all archs, then runs the mips[45]-fp tests twice,
once with -32 (fpisa4) and once with -mabi=o64 (fpisa4 && gpr64).
It could be argued that the gpr64 tests should always use the native
ABI on 64-bit targets, but it could also be argued that a bit of o64
testing on n32 systems gives broader scope.  If we worry too much
about things like that, we'll end up running all tests for all ABIs,
which would be a bit ridiculous.  I think we're already a little
overzealous in the number of combinations we're running.

I didn't want to go through and make every run_dump_test_arches pass ""
flag strings, so I made them optional, but kept them in the same position
as for run_list_test_arches.  At which point it seemed like a good idea
to make them optional for run_list_test_arches too.  I also added these
additional flags to the test name.

Tested on mips64-linux-gnu and mipsisa32-elf.  Applied.

Richard

gas/testsuite/
	* gas/mips/mips.exp (run_dump_test_arch): Add an opts parameter.
	(run_dump_test_arches): Allow additional options to be passed.
	(run_list_test_arch): Add opts to the name.
	(run_list_test_arches): Allow the options to be elided.
	(mips4-fp, mips5-fp): Run twice, one with -32 and once with -mabi=o64.
	(mips64r2-ill, octeon-ill): Remove empty options string.

Index: gas/testsuite/gas/mips/mips.exp
===================================================================
--- gas/testsuite/gas/mips/mips.exp	2011-12-03 09:29:03.000000000 +0000
+++ gas/testsuite/gas/mips/mips.exp	2011-12-03 10:16:53.000000000 +0000
@@ -286,10 +286,11 @@ proc mips_arch_list_matching {args} {
 
 # The functions below facilitate running various types of tests.
 
-# run_dump_test_arch NAME ARCH
+# run_dump_test_arch NAME OPTS ARCH
 #
-# Invoke "run_dump_test" for test NAME, with extra assembler and
-# disassembler flags to test architecture ARCH.
+# Invoke "run_dump_test" for test NAME with additional assembler options OPTS.
+# Add the assembler and disassembler flags that are associated with
+# architecture ARCH.
 #
 # You can override the expected output for particular architectures
 # and file formats.  The possible test names are, in order of preference:
@@ -302,7 +303,7 @@ proc mips_arch_list_matching {args} {
 # 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 } {
+proc run_dump_test_arch { name opts arch } {
     upvar elf elf ecoff ecoff aout aout
     global subdir srcdir
 
@@ -323,45 +324,61 @@ proc run_dump_test_arch { name arch } {
     }
 
     if [catch {run_dump_test $name \
-			     "{name    {([mips_arch_displayname $arch])}}
-			      {objdump {[mips_arch_objdump_flags $arch]}}
-			      {as      {[mips_arch_as_flags $arch]}}"} rv] {
+		   "{name    {([concat $opts [mips_arch_displayname $arch]])}}
+		    {objdump {[mips_arch_objdump_flags $arch]}}
+		    {as      {[concat $opts [mips_arch_as_flags $arch]]}}"} rv] {
         perror "$rv"
         untested "$subdir/$name ($arch)"
     }
 }
 
-# run_dump_test_arches NAME ARCH_LIST
+# run_dump_test_arches NAME [OPTS] ARCH_LIST
 #
 # Invoke "run_dump_test_arch" for test NAME, for each architecture
-# listed in ARCH_LIST.
-proc run_dump_test_arches { name arch_list } {
+# listed in ARCH_LIST.  OPTS, if specified, is a list of additional
+# assembler options that should be used for all architectures.
+proc run_dump_test_arches { name args } {
     upvar elf elf ecoff ecoff aout aout
+    set opts ""
+    if { [llength $args] > 1 } {
+	set opts [lindex $args 0]
+	set args [lrange $args 1 end]
+    }
+    set arch_list [lindex $args 0]
     foreach arch $arch_list {
-	run_dump_test_arch "$name" "$arch"
+	run_dump_test_arch $name $opts $arch
     }
 }
 
 # run_list_test_arch NAME OPTS ARCH
 #
-# Invoke "run_list_test" for test NAME with options OPTS, with extra
-# assembler flags to test architecture ARCH.
+# Invoke "run_list_test" for test NAME with additional assembler options OPTS.
+# Add the assembler flags that are associated with architecture ARCH.
 proc run_list_test_arch { name opts arch } {
     global subdir
 
-    set testname "MIPS $name ([mips_arch_displayname $arch])"
-    if [catch {run_list_test "$name" "$opts [mips_arch_as_flags $arch]" \
-			     "$testname"} rv] {
+    set testname "MIPS $name ([concat $opts [mips_arch_displayname $arch]])"
+    if [catch {run_list_test \
+		   $name \
+		   [concat $opts [mips_arch_as_flags $arch]] \
+		   $testname} rv] {
         perror "$rv"
         untested "$testname"
     }
 }
 
-# run_list_test_arches NAME OPTS ARCH_LIST
+# run_list_test_arches NAME [OPTS] ARCH_LIST
 #
-# Invoke "run_list_test_arch" for test NAME with options OPTS, for each
-# architecture listed in ARCH_LIST.
-proc run_list_test_arches { name opts arch_list } {
+# Invoke "run_list_test_arch" for test NAME, for each architecture listed
+# in ARCH_LIST.  OPTS, if specified, is a list of additional assembler
+# options that should be used for all architectures.
+proc run_list_test_arches { name args } {
+    set opts ""
+    if { [llength $args] > 1 } {
+	set opts [lindex $args 0]
+	set args [lrange $args 1 end]
+    }
+    set arch_list [lindex $args 0]
     foreach arch $arch_list {
 	run_list_test_arch "$name" "$opts" "$arch"
     }
@@ -636,14 +653,20 @@ if { [istarget mips*-*-vxworks*] } {
     if $elf { run_dump_test "lif-svr4pic" }
     if $elf { run_dump_test "lif-xgot" }
     run_dump_test_arches "mips4"	[mips_arch_list_matching mips4]
-    run_dump_test_arches "mips4-fp"	[mips_arch_list_matching fpisa4]
+    run_dump_test_arches "mips4-fp" "-32" \
+					[mips_arch_list_matching fpisa4]
+    run_dump_test_arches "mips4-fp" "-mabi=o64" \
+					[mips_arch_list_matching fpisa4 gpr64]
     run_list_test_arches "mips4-fp" "-32 -msoft-float" \
 					[mips_arch_list_matching fpisa4]
     run_dump_test_arches "mips4-branch-likely" \
 					[mips_arch_list_matching mips4]
     run_list_test_arches "mips4-branch-likely" "-32 -msoft-float" \
 					[mips_arch_list_matching mips4]
-    run_dump_test_arches "mips5-fp"	[mips_arch_list_matching fpisa5]
+    run_dump_test_arches "mips5-fp" "-32" \
+					[mips_arch_list_matching fpisa5]
+    run_dump_test_arches "mips5-fp" "-mabi=o64" \
+					[mips_arch_list_matching fpisa5 gpr64]
     run_dump_test "mul"
 
     run_dump_test_arches "rol"		[mips_arch_list_matching mips1 !ror]
@@ -739,7 +762,7 @@ if { [istarget mips*-*-vxworks*] } {
 					    !octeon]
 
     run_dump_test_arches "mips64r2"	[mips_arch_list_matching mips64r2]
-    run_list_test_arches "mips64r2-ill" "" [mips_arch_list_matching mips64r2]
+    run_list_test_arches "mips64r2-ill"	[mips_arch_list_matching mips64r2]
 
     run_dump_test "set-arch"
 
@@ -991,8 +1014,7 @@ if { [istarget mips*-*-vxworks*] } {
 
     run_dump_test_arches "octeon"	[mips_arch_list_matching octeon]
     run_dump_test_arches "octeon-saa-saad" [mips_arch_list_matching octeonp]
-    run_list_test_arches "octeon-ill" "" \
-					[mips_arch_list_matching octeon]
+    run_list_test_arches "octeon-ill"	[mips_arch_list_matching octeon]
     run_dump_test_arches "octeon-pref"	[mips_arch_list_matching octeon]
 
     run_dump_test "smartmips"


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