| 1 |
/* Test AAPCS layout (alignment of varargs) for callee. */ |
| 2 |
|
| 3 |
/* { dg-do run { target aarch64*-*-* } } */ |
| 4 |
|
| 5 |
#include <stdarg.h> |
| 6 |
|
| 7 |
extern void abort (void); |
| 8 |
|
| 9 |
typedef __attribute__ ((__aligned__ (16))) int alignedint; |
| 10 |
|
| 11 |
void |
| 12 |
test_pass_overaligned_int_vaargs (int i, ...) |
| 13 |
{ |
| 14 |
va_list va; |
| 15 |
va_start (va, i); |
| 16 |
/* alignedint should be pulled out of regs/stack just like an int. */ |
| 17 |
while (i-- > 0) |
| 18 |
if (va_arg (va, alignedint) != i) |
| 19 |
abort (); |
| 20 |
va_end (va); |
| 21 |
} |
| 22 |
|
| 23 |
int |
| 24 |
main (int argc, char **argv) |
| 25 |
{ |
| 26 |
test_pass_overaligned_int_vaargs (9, 8, 7, 6, 5, 4, 3, 2, 1, 0); |
| 27 |
return 0; |
| 28 |
} |