2 /* { dg-require-effective-target alloca } */
3 /* { dg-options "-O2 -fno-inline" } */
5 /* Test that targets correctly round the size of the outgoing arguments
6 to a multiple of STACK_BOUNDARY. There is a serious alignment bug if
7 aligned alloca does not get aligned! */
9 __extension__
typedef __UINTPTR_TYPE__
uintptr_t;
10 extern void abort (void);
16 t1 (int x0
, int x1
, int x2
, int x3
, int x4
, int x5
, int x6
, int x7
,
19 xx
= x0
+ x1
+ x2
+ x3
+ x4
+ x4
+ x6
+ x7
;
20 if ((int)(uintptr_t)p
& (align
-1))
25 t2 (int x0
, int x1
, int x2
, int x3
, int x4
, int x5
, int x6
, int x7
,
26 void *p
, int align
, int dummy
)
28 xx
= x0
+ x1
+ x2
+ x3
+ x4
+ x4
+ x6
+ x7
;
29 if ((int)(uintptr_t)p
& (align
-1))
36 void *p
= __builtin_alloca_with_align (size
, 32);
37 t1 (0, 0, 0, 0, 0, 0, 0, 0, p
, 4);
43 void *p
= __builtin_alloca_with_align (size
, 32);
44 t2 (0, 0, 0, 0, 0, 0, 0, 0, p
, 4, 0);
50 void *p
= __builtin_alloca_with_align (size
, 64);
51 t1 (0, 0, 0, 0, 0, 0, 0, 0, p
, 8);
57 void *p
= __builtin_alloca_with_align (size
, 64);
58 t2 (0, 0, 0, 0, 0, 0, 0, 0, p
, 8, 0);
64 void *p
= __builtin_alloca_with_align (size
, 128);
65 t1 (0, 0, 0, 0, 0, 0, 0, 0, p
, 16);
71 void *p
= __builtin_alloca_with_align (size
, 128);
72 t2 (0, 0, 0, 0, 0, 0, 0, 0, p
, 16, 0);
78 void *p
= __builtin_alloca_with_align (size
, 256);
79 t1 (0, 0, 0, 0, 0, 0, 0, 0, p
, 32);
85 void *p
= __builtin_alloca_with_align (size
, 256);
86 t2 (0, 0, 0, 0, 0, 0, 0, 0, p
, 32, 0);