This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Add arm_vfp_ok effective-target keyword


This patch adds a new effective-target keyword arm_vfp_ok, for ARM
tests that use VFP command-line options.

At present there is only one such test, but (a) more are pending to be
contributed and (b) contribution of -mcpu=iwmmxt2 support is also
pending, which will increase the number of options that need to be
excluded by such tests, so meaning it makes sense to have an
effective-target instead of hardcoding such lists of options.

It appears that get_compiler_messages doesn't correctly handle more
than one option being passed, so this patch also fixes
get_compiler_options to make the additional_flags= entry a single list
item.

Tested arm-none-eabi.  OK to commit to mainline?  How about 4.2?  4.1?

gcc/testsuite:
2006-10-29  Joseph Myers  <joseph@codesourcery.com>
            Richard Sandiford  <richard@codesourcery.com>

	* lib/target-supports.exp (get_compiler_messages): Append options
	as a single list element.
	(check_effective_target_arm_vfp_ok): New.
	* gcc.dg/arm-vfp1.c: Use arm_vfp_ok.

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 118092)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -37,7 +37,7 @@
     global tool
 
     if { [llength $args] > 0 } {
-	set options "additional_flags=[lindex $args 0]"
+	set options [list "additional_flags=[lindex $args 0]"]
     } else {
 	set options ""
     }
@@ -1296,6 +1296,20 @@
     return $et_arm32_saved
 }
 
+# Return 1 if this is an ARM target supporting -mfpu=vfp
+# -mfloat-abi=softfp.  Some multilibs may be incompatible with these
+# options.
+
+proc check_effective_target_arm_vfp_ok { } {
+    if { [check_effective_target_arm32] } {
+	return [check_no_compiler_messages arm_vfp_ok object {
+	    int dummy;
+	} "-mfpu=vfp -mfloat-abi=softfp"]
+    } else {
+	return 0
+    }
+}
+
 # Return 1 if this is a PowerPC target with floating-point registers.
 
 proc check_effective_target_powerpc_fprs { } {
Index: gcc/testsuite/gcc.dg/arm-vfp1.c
===================================================================
--- gcc/testsuite/gcc.dg/arm-vfp1.c	(revision 118092)
+++ gcc/testsuite/gcc.dg/arm-vfp1.c	(working copy)
@@ -1,7 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-O2 -mfpu=vfp -mfloat-abi=softfp" } */
-/* { dg-require-effective-target arm32 } */
-/* { dg-skip-if "" { *-*-* } { "-mcpu=iwmmxt" "-march=iwmmxt" } { "" } } */
+/* { dg-require-effective-target arm_vfp_ok } */
 
 extern float fabsf (float);
 extern float sqrtf (float);

-- 
Joseph S. Myers
joseph@codesourcery.com


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