aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-7.c
blob: b82e7a74217f0d64f0d7d233d6978913b9799ad8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* Test AAPCS64 layout and __builtin_va_arg.

   This test covers complex types.  Complex floating-point types are treated
   as homogeneous floating-point aggregates, while complex integral types
   are treated as general composite types.  */

/* { dg-do run { target aarch64*-*-* } } */

#ifndef IN_FRAMEWORK
#define AAPCS64_TEST_STDARG
#define TESTFILE "va_arg-7.c"
#include "type-def.h"

_Complex __int128 complex_qword = 567890 + 678901i;

#include "abitest.h"
#else
  ARG      (int, 1, X0, LAST_NAMED_ARG_ID)
  DOTS
  /* Complex floating-point types are passed in fp/simd registers.  */
  ANON     (_Complex float      , 12.3f + 23.4fi              , S0,  0)
  ANON     (_Complex double     , 34.56 + 45.67i              , D2,  1)
  ANON     (_Complex long double, 56789.01234L + 67890.12345Li, Q4,  2)

  /* Complex integral types are passed in general registers or via reference.  */
  ANON     (_Complex short      , (short)12345 + (short)23456i, X1, 10)
  ANON     (_Complex int        , 34567 + 45678i              , X2, 11)
  PTR_ANON (_Complex __int128   , complex_qword               , X3, 12)

  LAST_ANON(int                 , 1                           , X4, 20)
#endif