Patchwork [ARM] Skip gcc.dg/torture/stackalign/builtin-apply-2.c for ARM hard-float ABI

login
register
mail settings
Submitter Julian Brown
Date July 24, 2012, 11:17 a.m.
Message ID <20120724121742.1993f20a@octopus>
Download mbox | patch
Permalink /patch/172832/
State New
Headers show

Comments

Julian Brown - July 24, 2012, 11:17 a.m.
On Mon, 23 Jul 2012 17:41:03 +0100
Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org> wrote:

> On 23 July 2012 16:41, Julian Brown <julian@codesourcery.com> wrote:
> > On Mon, 23 Jul 2012 14:40:59 +0100
> > Richard Earnshaw <rearnsha@arm.com> wrote:
> >
> >> On 23/07/12 13:17, Julian Brown wrote:
> >> > Hi,
> >> >
> >> > The test case gcc.dg/torture/stackalign/builtin-apply-2.c makes
> >> > assumptions which cannot be met for __builtin_apply for the ARM
> >> > hard-float ABI variant. This patch simply skips the test in that
> >> > case.
> >> >
> >> > Tested (stackalign.exp only) for ARMv4t
> >> > -marm/-mthumb/-mfloat-abi=hard. The previously-failing test gets
> >> > skipped as expected with the patch. (This is another one that
> >> > we've had locally for a while.)
> >>
> >> Hmm, I think this won't work for platforms like fedora/arm, where
> >> -mfloat-abi=hard is the default.
> >
> > Yes, you're probably right. Here's a new version, which still seems
> > to work for my test environment. I'm not prepared to test a
> > compiler which has the hard-float ABI turned on by default, but I
> > think this should work in theory.
> >
> > (I didn't find an existing check_effective_target_<foo> function
> > suitable for this purpose, so I had to add one.)
> 
> Unfortunately arm_hard_vfp_ok doesn't serve this purpose. This should
> be documented in doc/sourcebuild.texi.( I will note that a number of
> new effective_targets for the ARM port haven't made it in there but
> that's a subject for a future patch but it would be better if we got
> this one right :) )
> 
> Ok with appropriate documentation to sourcebuild.texi and checking
> that the documentation builds fine.

Thanks, I'll apply this version.

Julian

ChangeLog

    * doc/sourcebuild.texi (arm_hf_eabi): Document effective-target
    check.

    gcc/testsuite/
    * lib/target-supports.exp (check_effective_target_arm_hf_eabi): New.
    * gcc.dg/torture/stackalign/builtin-apply-2.c: Skip for
    hard-float ARM.

Patch

Index: gcc/doc/sourcebuild.texi
===================================================================
--- gcc/doc/sourcebuild.texi	(revision 189803)
+++ gcc/doc/sourcebuild.texi	(working copy)
@@ -1497,6 +1497,11 @@  ARM target generates 32-bit code.
 @item arm_eabi
 ARM target adheres to the ABI for the ARM Architecture.
 
+@item arm_hf_eabi
+ARM target adheres to the VFP and Advanced SIMD Register Arguments
+variant of the ABI for the ARM Architecture (as selected with
+@code{-mfloat-abi=hard}).
+
 @item arm_hard_vfp_ok
 ARM target supports @code{-mfpu=vfp -mfloat-abi=hard}.
 Some multilibs may be incompatible with these options.
Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 189803)
+++ gcc/testsuite/lib/target-supports.exp	(working copy)
@@ -2341,6 +2341,19 @@  proc check_effective_target_arm_eabi { }
     }]
 }
 
+# Return 1 if this is an ARM target that adheres to the hard-float variant of
+# the ABI for the ARM Architecture (e.g. -mfloat-abi=hard).
+
+proc check_effective_target_arm_hf_eabi { } {
+    return [check_no_compiler_messages arm_hf_eabi object {
+	#if !defined(__ARM_EABI__) || !defined(__ARM_PCS_VFP)
+	#error not hard-float EABI
+	#else
+	int dummy;
+	#endif
+    }]
+}
+
 # Return 1 if this is an ARM target supporting -mcpu=iwmmxt.
 # Some multilibs may be incompatible with this option.
 
Index: gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c	(revision 189803)
+++ gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c	(working copy)
@@ -5,6 +5,8 @@ 
    with pre-pushed arguments (e.g. SPARC).  */
 
 /* { dg-do run } */
+
+/* { dg-skip-if "Variadic funcs use Base AAPCS.  Normal funcs use VFP variant." { arm_hf_eabi } } */
    
 
 #define INTEGER_ARG  5