diff mbox

[testsuite] fix to check_effective_target_arm_hard_vfp_ok

Message ID 505BD687.3030408@mentor.com
State New
Headers show

Commit Message

Janis Johnson Sept. 21, 2012, 2:52 a.m. UTC
Tests in gcc.target/arm/aapcs check for floating-point arguments being
passed correctly, but the added flag "-mfloat-abi=hard" can be
overridden by another value in flags used for all tests (like multilib
flags), causing the tests to fail.  The tests in that directory are all
gated on effective-target arm_hard_vfp_ok; this patch changes its code
to return 0 if the test will use a different value of -mfloat-abi.

Tested on arm-none-eabi with a variety of test flags.  I'm hoping to
hear from ARM experts that this is OK; there are a handful of tests in
arm/aapcs that pass even with -mfloat-abi=softfp, so a better solution
might be to skip individual tests for that option.

Janis
2012-09-20  Janis Johnson  <janisjo@codesourcery.com>

	* lib/target-supports.exp (check_effective_target_arm_hard_vfp_ok):
	Return 0 if already specifying -mfloat-abi other than hard.

Comments

Richard Earnshaw Oct. 10, 2012, 10:46 a.m. UTC | #1
On 21/09/12 03:52, Janis Johnson wrote:
> Tests in gcc.target/arm/aapcs check for floating-point arguments being
> passed correctly, but the added flag "-mfloat-abi=hard" can be
> overridden by another value in flags used for all tests (like multilib
> flags), causing the tests to fail.  The tests in that directory are all
> gated on effective-target arm_hard_vfp_ok; this patch changes its code
> to return 0 if the test will use a different value of -mfloat-abi.
>
> Tested on arm-none-eabi with a variety of test flags.  I'm hoping to
> hear from ARM experts that this is OK; there are a handful of tests in
> arm/aapcs that pass even with -mfloat-abi=softfp, so a better solution
> might be to skip individual tests for that option.
>
> Janis
>
>
> gcc-20120920-2
>
>
> 2012-09-20  Janis Johnson  <janisjo@codesourcery.com>
>
> 	* lib/target-supports.exp (check_effective_target_arm_hard_vfp_ok):
> 	Return 0 if already specifying -mfloat-abi other than hard.
>

OK.

R.

> Index: lib/target-supports.exp
> ===================================================================
> --- lib/target-supports.exp	(revision 191501)
> +++ lib/target-supports.exp	(working copy)
> @@ -2053,7 +2053,8 @@
>   # options.
>
>   proc check_effective_target_arm_hard_vfp_ok { } {
> -    if { [check_effective_target_arm32] } {
> +    if { [check_effective_target_arm32]
> +	 && ! [check-flags [list "" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" }]] } {
>   	return [check_no_compiler_messages arm_hard_vfp_ok executable {
>   	    int main() { return 0;}
>   	} "-mfpu=vfp -mfloat-abi=hard"]
>
diff mbox

Patch

Index: lib/target-supports.exp
===================================================================
--- lib/target-supports.exp	(revision 191501)
+++ lib/target-supports.exp	(working copy)
@@ -2053,7 +2053,8 @@ 
 # options.
 
 proc check_effective_target_arm_hard_vfp_ok { } {
-    if { [check_effective_target_arm32] } {
+    if { [check_effective_target_arm32] 
+	 && ! [check-flags [list "" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=hard" }]] } {
 	return [check_no_compiler_messages arm_hard_vfp_ok executable {
 	    int main() { return 0;}
 	} "-mfpu=vfp -mfloat-abi=hard"]