| 1 |
/* Test AAPCS layout (alignment). */ |
| 2 |
|
| 3 |
/* { dg-do run { target aarch64*-*-* } } */ |
| 4 |
|
| 5 |
#ifndef IN_FRAMEWORK |
| 6 |
#define TESTFILE "test_align-8.c" |
| 7 |
|
| 8 |
/* The alignment also gives this size 32, so will be passed by reference. */ |
| 9 |
typedef struct __attribute__ ((__aligned__ (32))) |
| 10 |
{ |
| 11 |
long x; |
| 12 |
long y; |
| 13 |
} overaligned; |
| 14 |
|
| 15 |
#define EXPECTED_STRUCT_SIZE 32 |
| 16 |
extern void link_failure (void); |
| 17 |
int |
| 18 |
foo () |
| 19 |
{ |
| 20 |
/* Optimization gets rid of this before linking. */ |
| 21 |
if (sizeof (overaligned) != EXPECTED_STRUCT_SIZE) |
| 22 |
link_failure (); |
| 23 |
} |
| 24 |
|
| 25 |
overaligned a = { 2, 3 }; |
| 26 |
|
| 27 |
#include "abitest.h" |
| 28 |
#else |
| 29 |
ARG (int, 7, W0) |
| 30 |
/* Alignment should be 8. */ |
| 31 |
PTR (overaligned, a, X1) |
| 32 |
LAST_ARG (int, 9, W2) |
| 33 |
#endif |