* gcc.dg/torture/stackalign/builtin-apply-2.c: Fix skip-if syntax.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / stackalign / builtin-apply-2.c
blob41b5c05b3f8cd0b95d82675f28feca3c8a5fd9ef
1 /* PR target/12503 */
2 /* Origin: <pierre.nguyen-tuong@asim.lip6.fr> */
4 /* Verify that __builtin_apply behaves correctly on targets
5 with pre-pushed arguments (e.g. SPARC). */
7 /* { dg-do run } */
9 /* arm_hf_eabi: Variadic funcs use Base AAPCS. Normal funcs use VFP variant.
10 avr: Variadic funcs don't pass arguments in registers, while normal funcs
11 do. */
12 /* { dg-skip-if "Variadic funcs use different argument passing from normal funcs" { arm_hf_eabi || { avr-*-* riscv*-*-* } } "*" "" } */
13 /* { dg-skip-if "Variadic funcs have all args on stack. Normal funcs have args in registers." { nds32*-*-* } "*" "" } */
14 /* { dg-require-effective-target untyped_assembly } */
17 #define INTEGER_ARG 5
19 #if defined(__ARM_PCS) || defined(__epiphany__)
20 /* For Base AAPCS, NAME is passed in r0. D is passed in r2 and r3.
21 E, F and G are passed on stack. So the size of the stack argument
22 data is 20. */
23 #define STACK_ARGUMENTS_SIZE 20
24 #elif defined __aarch64__ || defined __arc__ || defined __MMIX__
25 /* No parameters on stack for bar. */
26 #define STACK_ARGUMENTS_SIZE 0
27 #else
28 #define STACK_ARGUMENTS_SIZE 64
29 #endif
31 extern void abort(void);
33 void foo(char *name, double d, double e, double f, int g)
35 if (g != INTEGER_ARG)
36 abort();
39 void bar(char *name, ...)
41 __builtin_apply(foo, __builtin_apply_args(), STACK_ARGUMENTS_SIZE);
44 int main(void)
46 bar("eeee", 5.444567, 8.90765, 4.567789, INTEGER_ARG);
48 return 0;