This is the mail archive of the
mailing list for the GCC project.
Re: [testsuite, ARM] Fix gcc.dg/builtin-apply2.c for ARM EABI
On 08/18/2010 03:55 AM, Chung-Lin Tang wrote:
Mark Mitchell wrote:
Yes. It will be skipped when -mfloat-abi=hard.
Jie Zhang wrote:
When testing GCC on a Cortex-M4 board, gcc.dg/builtin-apply2.c will hang
the testing. That is because we should not use 64 as the size of the
stack argument. For ARM EABI, NAME is passed in r0. D is passed in r2
and r3. E, F and G are passed on stack.
Is this true in all variants of the ABI? Or do we need to worry about
hard-float vs. soft-float ABIs?
This test is skipped for hard-float, due to the case of passing
arguments to a variadic function; it simply won't pass under
Yes, it's a little better to use __ARM_PCS here. The patch is updated.
Jie, while you're at it, why not use the new __ARM_PCS symbol instead of
It more accurately marks the softfp conventions you're trying to assume
* gcc.dg/builtin-apply2.c (STACK_ARGUMENTS_SIZE): Define to
20 if __ARM_PCS is defined otherwise 64.
(bar): Use STACK_ARGUMENTS_SIZE for the third argument
instead of hard coded 64.
--- gcc.dg/builtin-apply2.c (revision 163327)
+++ gcc.dg/builtin-apply2.c (working copy)
@@ -8,10 +8,19 @@
/* Verify that __builtin_apply behaves correctly on targets
with pre-pushed arguments (e.g. SPARC). */
#define INTEGER_ARG 5
+/* For Base AAPCS, NAME is passed in r0. D is passed in r2 and r3.
+ E, F and G are passed on stack. So the size of the stack argument
+ data is 20. */
+#define STACK_ARGUMENTS_SIZE 20
+#define STACK_ARGUMENTS_SIZE 64
extern void abort(void);
void foo(char *name, double d, double e, double f, int g)
@@ -22,7 +31,7 @@ void foo(char *name, double d, double e,
void bar(char *name, ...)
- __builtin_apply(foo, __builtin_apply_args(), 64);
+ __builtin_apply(foo, __builtin_apply_args(), STACK_ARGUMENTS_SIZE);