[arm] Fix gcc.target/arm/pr40887.c directives

Message ID 5A5F3185.2090803@foss.arm.com
State New
Headers show
Series
  • [arm] Fix gcc.target/arm/pr40887.c directives
Related show

Commit Message

Kyrill Tkachov Jan. 17, 2018, 11:20 a.m.
Hi all,

This patch converts gcc.target/arm/pr40887.c to use the proper effective target check and dg-add-options for armv5te
so that we avoid situations where we end up trying to compile the test with a Thumb1 hard-float ABI, which makes the
compiler complain.

This allows the test to pass gracefully for me for my compiler configured with:
--with-cpu=cortex-a15 --with-fpu=neon-vfpv4 --with-float=hard --with-mode=thumb

Committing to trunk.

Thanks,
Kyrill

2018-01-17  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

     * gcc.target/arm/pr40887.c: Add armv5te effective target checks and
     directives.

Comments

Christophe Lyon Jan. 18, 2018, 9:15 a.m. | #1
Hi Kyrill,


On 17 January 2018 at 12:20, Kyrill  Tkachov
<kyrylo.tkachov@foss.arm.com> wrote:
> Hi all,

>

> This patch converts gcc.target/arm/pr40887.c to use the proper effective

> target check and dg-add-options for armv5te

> so that we avoid situations where we end up trying to compile the test with

> a Thumb1 hard-float ABI, which makes the

> compiler complain.

>

> This allows the test to pass gracefully for me for my compiler configured

> with:

> --with-cpu=cortex-a15 --with-fpu=neon-vfpv4 --with-float=hard

> --with-mode=thumb

>

> Committing to trunk.

>

> Thanks,

> Kyrill

>

> 2018-01-17  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

>

>     * gcc.target/arm/pr40887.c: Add armv5te effective target checks and

>     directives.


I think you had to swap dg-options and dg-add-options directives, so I
committed the attached patch as obvious.

Christophe
2018-01-18  Christophe Lyon  <christophe.lyon@linaro.org>

	* gcc.target/arm/pr40887.c: Fix dg-options and dg-add-options
	order.
Index: gcc/testsuite/gcc.target/arm/pr40887.c
===================================================================
--- gcc/testsuite/gcc.target/arm/pr40887.c	(revision 256838)
+++ gcc/testsuite/gcc.target/arm/pr40887.c	(revision 256839)
@@ -1,8 +1,8 @@
 /* { dg-do compile } */
 /* { dg-skip-if "need at least armv5" { *-*-* } { "-march=armv[234]*" } { "" } } */
 /* { dg-require-effective-target arm_arch_v5te_ok } */
+/* { dg-options "-O2" }  */
 /* { dg-add-options arm_arch_v5te } */
-/* { dg-options "-O2" }  */
 /* { dg-final { scan-assembler "blx" } } */
 
 int (*indirect_func)(int x);
Kyrill Tkachov Jan. 18, 2018, 9:25 a.m. | #2
On 18/01/18 09:15, Christophe Lyon wrote:
> Hi Kyrill,

>

>

> On 17 January 2018 at 12:20, Kyrill  Tkachov

> <kyrylo.tkachov@foss.arm.com> wrote:

>> Hi all,

>>

>> This patch converts gcc.target/arm/pr40887.c to use the proper effective

>> target check and dg-add-options for armv5te

>> so that we avoid situations where we end up trying to compile the test with

>> a Thumb1 hard-float ABI, which makes the

>> compiler complain.

>>

>> This allows the test to pass gracefully for me for my compiler configured

>> with:

>> --with-cpu=cortex-a15 --with-fpu=neon-vfpv4 --with-float=hard

>> --with-mode=thumb

>>

>> Committing to trunk.

>>

>> Thanks,

>> Kyrill

>>

>> 2018-01-17  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

>>

>>      * gcc.target/arm/pr40887.c: Add armv5te effective target checks and

>>      directives.

> I think you had to swap dg-options and dg-add-options directives, so I

> committed the attached patch as obvious.


Thanks Christophe,
I had spotted it and was planning to fix it by using dg-additional-options,
but it's the same in the end.

Kyrill

> Christophe
Christophe Lyon Jan. 18, 2018, 2:02 p.m. | #3
On 18 January 2018 at 10:25, Kyrill  Tkachov
<kyrylo.tkachov@foss.arm.com> wrote:
>

> On 18/01/18 09:15, Christophe Lyon wrote:

>>

>> Hi Kyrill,

>>

>>

>> On 17 January 2018 at 12:20, Kyrill  Tkachov

>> <kyrylo.tkachov@foss.arm.com> wrote:

>>>

>>> Hi all,

>>>

>>> This patch converts gcc.target/arm/pr40887.c to use the proper effective

>>> target check and dg-add-options for armv5te

>>> so that we avoid situations where we end up trying to compile the test

>>> with

>>> a Thumb1 hard-float ABI, which makes the

>>> compiler complain.

>>>

>>> This allows the test to pass gracefully for me for my compiler configured

>>> with:

>>> --with-cpu=cortex-a15 --with-fpu=neon-vfpv4 --with-float=hard

>>> --with-mode=thumb

>>>

>>> Committing to trunk.

>>>

>>> Thanks,

>>> Kyrill

>>>

>>> 2018-01-17  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

>>>

>>>      * gcc.target/arm/pr40887.c: Add armv5te effective target checks and

>>>      directives.

>>

>> I think you had to swap dg-options and dg-add-options directives, so I

>> committed the attached patch as obvious.

>

>

> Thanks Christophe,

> I had spotted it and was planning to fix it by using dg-additional-options,

> but it's the same in the end.

>


Hmmm after my commit, I see again the "unimplemented: Thumb-1
hard-float VFP ABI"
error, because the arm_arch_v5te_ok effective target test pass as it
uses a testcase
containing no actual code. My old patch for
check_effective_target_arm_arch_FUNC_ok
would be helpful :-) (I'm posting it again separately)

Christophe

> Kyrill

>

>> Christophe

>

>

Patch

diff --git a/gcc/testsuite/gcc.target/arm/pr40887.c b/gcc/testsuite/gcc.target/arm/pr40887.c
index 0329916d014c034fb37dbc62b6a2a99c32aa6510..5baa05695374a3746c2d08801da5d31c729def2a 100644
--- a/gcc/testsuite/gcc.target/arm/pr40887.c
+++ b/gcc/testsuite/gcc.target/arm/pr40887.c
@@ -1,5 +1,8 @@ 
+/* { dg-do compile } */
 /* { dg-skip-if "need at least armv5" { *-*-* } { "-march=armv[234]*" } { "" } } */
-/* { dg-options "-O2 -march=armv5te" }  */
+/* { dg-require-effective-target arm_arch_v5te_ok } */
+/* { dg-add-options arm_arch_v5te } */
+/* { dg-options "-O2" }  */
 /* { dg-final { scan-assembler "blx" } } */
 
 int (*indirect_func)(int x);