| 1 |
/* Test AAPCS64 layout and __builtin_va_start. |
| 2 |
|
| 3 |
Pass named HFA/HVA argument on stack. */ |
| 4 |
|
| 5 |
/* { dg-do run { target aarch64*-*-* } } */ |
| 6 |
|
| 7 |
#ifndef IN_FRAMEWORK |
| 8 |
#define AAPCS64_TEST_STDARG |
| 9 |
#define TESTFILE "va_arg-13.c" |
| 10 |
|
| 11 |
struct float_float_t |
| 12 |
{ |
| 13 |
float a; |
| 14 |
float b; |
| 15 |
} float_float; |
| 16 |
|
| 17 |
union float_int_t |
| 18 |
{ |
| 19 |
float b8; |
| 20 |
int b5; |
| 21 |
} float_int; |
| 22 |
|
| 23 |
#define HAS_DATA_INIT_FUNC |
| 24 |
void |
| 25 |
init_data () |
| 26 |
{ |
| 27 |
float_float.a = 1.2f; |
| 28 |
float_float.b = 2.2f; |
| 29 |
|
| 30 |
float_int.b8 = 4983.80f; |
| 31 |
} |
| 32 |
|
| 33 |
#include "abitest.h" |
| 34 |
#else |
| 35 |
ARG (float, 1.0f, S0, 0) |
| 36 |
ARG (float, 2.0f, S1, 1) |
| 37 |
ARG (float, 3.0f, S2, 2) |
| 38 |
ARG (float, 4.0f, S3, 3) |
| 39 |
ARG (float, 5.0f, S4, 4) |
| 40 |
ARG (float, 6.0f, S5, 5) |
| 41 |
ARG (float, 7.0f, S6, 6) |
| 42 |
ARG (struct float_float_t, float_float, STACK, 7) |
| 43 |
ARG (int, 9, W0, 8) |
| 44 |
ARG (int, 10, W1, 9) |
| 45 |
ARG (int, 11, W2, 10) |
| 46 |
ARG (int, 12, W3, 11) |
| 47 |
ARG (int, 13, W4, 12) |
| 48 |
ARG (int, 14, W5, 13) |
| 49 |
ARG (int, 15, W6, LAST_NAMED_ARG_ID) |
| 50 |
DOTS |
| 51 |
/* Note on the reason of using 'X7' instead of 'W7' here: |
| 52 |
Using 'X7' makes sure the test works in the big-endian mode. |
| 53 |
According to PCS rules B.4 and C.10, the size of float_int is rounded |
| 54 |
to 8 bytes and prepared in the register X7 as if loaded via LDR from |
| 55 |
the memory, with the content of the other 4 bytes unspecified. The |
| 56 |
test framework will only compare the 4 relavent bytes. */ |
| 57 |
ANON (union float_int_t, float_int, X7, 15) |
| 58 |
LAST_ANON (long long, 12683143434LL, STACK + 8, 16) |
| 59 |
#endif |