Imported Upstream version 4.8.1
[platform/upstream/gcc48.git] / gcc / testsuite / gcc.target / aarch64 / aapcs64 / va_arg-6.c
1 /* Test AAPCS64 layout and __builtin_va_arg.
2
3    This test is focus on certain unnamed homogeneous floating-point aggregate
4    types passed in fp/simd registers.  */
5
6 /* { dg-do run { target aarch64*-*-* } } */
7
8 #ifndef IN_FRAMEWORK
9 #define AAPCS64_TEST_STDARG
10 #define TESTFILE "va_arg-6.c"
11 #include "type-def.h"
12
13 struct hfa_fx1_t hfa_fx1 = {12.345f};
14 struct hfa_dx2_t hfa_dx2 = {234.567, 345.678};
15 struct hfa_ffs_t hfa_ffs;
16 union hfa_union_t hfa_union;
17
18 #define HAS_DATA_INIT_FUNC
19 void init_data ()
20 {
21   hfa_union.s.a = 37.f;
22   hfa_union.s.b = 38.f;
23   hfa_union.c   = 39.f;
24
25   hfa_ffs.a = 42.f;
26   hfa_ffs.b = 43.f;
27   hfa_ffs.c.a = 44.f;
28   hfa_ffs.c.b = 45.f;
29 }
30
31 #include "abitest.h"
32 #else
33   ARG      (int, 1, X0, LAST_NAMED_ARG_ID)
34   DOTS
35   ANON     (struct hfa_ffs_t  , hfa_ffs  , S0     , 0)
36   ANON     (union  hfa_union_t, hfa_union, S4     , 1)
37   ANON     (struct hfa_dx2_t  , hfa_dx2  , D6     , 2)
38   ANON     (struct hfa_fx1_t  , hfa_fx1  , STACK  , 3)
39   LAST_ANON(double            , 1.0      , STACK+8, 4)
40 #endif