Message ID | 1436456373-3369-1-git-send-email-christophe.lyon@linaro.org |
---|---|
State | New |
Headers | show |
On 07/09/2015 05:39 PM, Christophe Lyon wrote: > Some multilibs do not support Thumb mode on ARM targets. This is the > case for instance when target is arm-linux-gnueabihf and with > -march=armv5-t: Thumb-1 hard-float VFP ABI is not implemented. > > In this configuration, gcc.target/arm/attr_thumb.c is failing because > we switch thumb mode via an attribute. > > This patch makes this test unsupported, by adding a new function in > lib/target-supports.exp: check_effective_target_arm_thumb_ok. > > OK? > What about just skip-if { ! { arm_thumb1_ok || arm_thumb2_ok } } , for consistency with the other tests using -mthumb ? Can you add the same check to flip-thumb.c as well (must have been also FAIL for your configuration) ? thanks Christian
diff --git a/gcc/testsuite/gcc.target/arm/attr_thumb.c b/gcc/testsuite/gcc.target/arm/attr_thumb.c index 02ddfda..6553e65 100644 --- a/gcc/testsuite/gcc.target/arm/attr_thumb.c +++ b/gcc/testsuite/gcc.target/arm/attr_thumb.c @@ -1,5 +1,7 @@ /* Check that attribute target thumb is recognized. */ /* { dg-do compile } */ +/* Make sure the current multilib supports thumb. */ +/* { dg-require-effective-target arm_thumb_ok } */ /* { dg-options "-O2 -mno-restrict-it" } */ /* { dg-final { scan-assembler-not "\\.arm" } } */ /* { dg-final { scan-assembler "\\.thumb_func" } } */ diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index bf512e9..7cc5bbf 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2910,6 +2910,15 @@ foreach { armfunc armflag armdef } { v4 "-march=armv4 -marm" __ARM_ARCH_4__ }] } +# Return 1 if this is an ARM target supporting -mthumb. Some +# multilibs may be incompatible with this option. + +proc check_effective_target_arm_thumb_ok { } { + return [check_no_compiler_messages arm_thumb_ok object { + int foo (int i) { return i; } + } "-mthumb"] +} + # Return 1 if this is an ARM target where -marm causes ARM to be # used (not Thumb)