[committed] Skip hard-float MIPS16 tests unless using o32 and o64

Richard Sandiford rsandifo@nildram.co.uk
Mon Sep 24 20:49:00 GMT 2007


Switching to mipsisa64-elf (as opposed to mipsisa64-elfoabi) showed that
we were trying to test hard-float MIPS16 code for EABI, whereas that
combination is only supported for o32 and o64.  The patch below refines
check_effective_target_mips16_attribute accordingly.  A couple of places
assumed that all mipsisa*-elf configurations would support mips16, so the
patch updates those too.

Tested on mipsisa64-elf and mipsisa64-elfoabi.  Applied to trunk.

Richard


gcc/testsuite/
	* lib/target-supports.exp (check_effective_target_mips16_attribute):
	Reject hard-float modes unless the ABI is o32 or o64.
	* gcc.target/mips/inter/mips16-inter.exp: Load gcc-dg.exp instead
	of gcc.exp.  Skip the tests when mips16 code generation is not
	supported.
	* gcc.target/mips/mips16-attributes.c: Require mips16_attribute
	and use dg-add-options mips16_attribute.

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 128722)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -648,10 +648,17 @@ proc add_options_for_mips16_attribute { 
 }
 
 # Return true if we can force a mode that allows MIPS16 code generation.
+# We don't support MIPS16 PIC, and only support MIPS16 -mhard-float
+# for o32 and o64.
 
 proc check_effective_target_mips16_attribute { } {
     return [check_no_compiler_messages mips16_attribute assembly {
-	#if __PIC__
+	#ifdef PIC
+	#error FOO
+	#endif
+	#if defined __mips_hard_float \
+	    && (!defined _ABIO32 || _MIPS_SIM != _ABIO32) \
+	    && (!defined _ABIO64 || _MIPS_SIM != _ABIO64)
 	#error FOO
 	#endif
     } [add_options_for_mips16_attribute ""]]
Index: gcc/testsuite/gcc.target/mips/inter/mips16-inter.exp
===================================================================
--- gcc/testsuite/gcc.target/mips/inter/mips16-inter.exp	(revision 128722)
+++ gcc/testsuite/gcc.target/mips/inter/mips16-inter.exp	(working copy)
@@ -6,6 +6,13 @@ if { ![istarget mipsisa*-*-elf*] && ![is
     return
 }
 
+load_lib gcc-dg.exp
+
+# Check whether the flags are compatible with MIPS16 code generation.
+if { ![check_effective_target_mips16_attribute] } {
+    return
+}
+
 # Save the old value of CFLAGS_FOR_TARGET, if any.
 global saved_CFLAGS_FOR_TARGET
 if { [info exists CFLAGS_FOR_TARGET] } {
@@ -36,7 +43,6 @@ proc compat-use-tst-compiler { } {
     }
 }
 
-load_lib gcc.exp
 load_lib compat.exp
 
 gcc_init
Index: gcc/testsuite/gcc.target/mips/mips16-attributes.c
===================================================================
--- gcc/testsuite/gcc.target/mips/mips16-attributes.c	(revision 128722)
+++ gcc/testsuite/gcc.target/mips/mips16-attributes.c	(working copy)
@@ -1,7 +1,8 @@
 /* Verify that mips16 and nomips16 attributes work, checking all combinations
    of calling a nomips16/mips16/default function from a nomips16/mips16/default
    function.  */
-/* { dg-do run { target mipsisa*-*-elf* } } */
+/* { dg-do run { target { mipsisa*-*-elf* && mips16_attribute } } } */
+/* { dg-add-options mips16_attribute } */
 
 #include <stdlib.h>
 



More information about the Gcc-patches mailing list