diff mbox

[testsuite] Disable attr_thumb.c test when Thumb mode is not supported.

Message ID CAKdteOaFHLM=OUrueWa1JRL__Rc6H4CSDXG9eH=Ja8NitWRoYg@mail.gmail.com
State New
Headers show

Commit Message

Christophe Lyon July 10, 2015, 11:35 a.m. UTC
On 10 July 2015 at 09:14, Christian Bruel <christian.bruel@st.com> wrote:
>
> 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 ?
OK, let's be consistent.

> Can you add the same check to flip-thumb.c as well (must have been also FAIL
> for your configuration) ?
Indeed, I noticed it when you added that test, then forgot to merge both fixes.

> thanks
>
> Christian
>
2015-07-10  Christophe Lyon  <christophe.lyon@linaro.org>

    * gcc.target/arm/attr_thumb.c: Skip if Thumb is not supported.
    * gcc.target/arm/flip-thumb.c: Likewise.

Comments

Christophe Lyon July 10, 2015, 11:55 a.m. UTC | #1
On 10 July 2015 at 13:40, Ramana Radhakrishnan
<ramana.radhakrishnan@foss.arm.com> wrote:
>
>
> On 10/07/15 12:35, Christophe Lyon wrote:
>> On 10 July 2015 at 09:14, Christian Bruel <christian.bruel@st.com> wrote:
>>>
>>> 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 ?
>> OK, let's be consistent.
>>
>>> Can you add the same check to flip-thumb.c as well (must have been also FAIL
>>> for your configuration) ?
>> Indeed, I noticed it when you added that test, then forgot to merge both fixes.
>>
>
> OK -
> regards
> Ramana
>
> P.S. Is it really interesting to test Thumb1 / armv5t on mfloat-abi=hard configurations especially as Thumb1 doesn't have any instructions to move values into the VFP register bank ?
>
Well, I am testing this configuration:
--target=arm-none-linux-gnueabihf --with-mode=arm --with-cpu=cortex-a9
--with-fpu=vfp
and RUNTESTFLAGS=-march=armv5-t

A few tests do force Thumb1, and fail because HF+Thumb1 is not supported.


>
>>> thanks
>>>
>>> Christian
>>>
>> 2015-07-10  Christophe Lyon  <christophe.lyon@linaro.org>
>>
>>     * gcc.target/arm/attr_thumb.c: Skip if Thumb is not supported.
>>     * gcc.target/arm/flip-thumb.c: Likewise.
>>
>> diff --git a/gcc/testsuite/gcc.target/arm/attr_thumb.c
>> b/gcc/testsuite/gcc.target/arm/attr_thumb.c
>> index 02ddfda..eac4713 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-skip-if "" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */
>>  /* { dg-options "-O2 -mno-restrict-it" } */
>>  /* { dg-final { scan-assembler-not "\\.arm"  } } */
>>  /* { dg-final { scan-assembler "\\.thumb_func" } } */
>> diff --git a/gcc/testsuite/gcc.target/arm/flip-thumb.c
>> b/gcc/testsuite/gcc.target/arm/flip-thumb.c
>> index 9154799..355d663 100644
>> --- a/gcc/testsuite/gcc.target/arm/flip-thumb.c
>> +++ b/gcc/testsuite/gcc.target/arm/flip-thumb.c
>> @@ -1,5 +1,7 @@
>>  /* Check -mflip-thumb. */
>>  /* { dg-do compile } */
>> +/* Make sure the current multilib supports thumb.  */
>> +/* { dg-skip-if "" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */
>>  /* { dg-options "-O2 -mflip-thumb -mno-restrict-it" } */
>>  /* { dg-final { scan-assembler "\\.arm" } } */
>>  /* { dg-final { scan-assembler-times "\\.thumb_func" 1} } */
>>
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.target/arm/attr_thumb.c
b/gcc/testsuite/gcc.target/arm/attr_thumb.c
index 02ddfda..eac4713 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-skip-if "" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */
 /* { dg-options "-O2 -mno-restrict-it" } */
 /* { dg-final { scan-assembler-not "\\.arm"  } } */
 /* { dg-final { scan-assembler "\\.thumb_func" } } */
diff --git a/gcc/testsuite/gcc.target/arm/flip-thumb.c
b/gcc/testsuite/gcc.target/arm/flip-thumb.c
index 9154799..355d663 100644
--- a/gcc/testsuite/gcc.target/arm/flip-thumb.c
+++ b/gcc/testsuite/gcc.target/arm/flip-thumb.c
@@ -1,5 +1,7 @@ 
 /* Check -mflip-thumb. */
 /* { dg-do compile } */
+/* Make sure the current multilib supports thumb.  */
+/* { dg-skip-if "" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */
 /* { dg-options "-O2 -mflip-thumb -mno-restrict-it" } */
 /* { dg-final { scan-assembler "\\.arm" } } */
 /* { dg-final { scan-assembler-times "\\.thumb_func" 1} } */