aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/aarch64/aapcs64/test_align-4.c
blob: 7834ed87e78217d6a511d9b6e39aa3af0073f254 (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
32
33
34
35
36
37
38
39
40
41
42
/* Test AAPCS64 layout.

   C.3 If the argument is an HFA then the NSRN is set to 8 and the size
   of the argument is rounded up to the nearest multiple of 8 bytes.

   TODO: add the check of an HFA containing half-precision floating-point
   when __f16 is supported in A64 GCC.  */

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

#ifndef IN_FRAMEWORK
#define TESTFILE "test_align-4.c"

struct z1
{
  double x[4];
};

struct z1 a = { 5.0, 6.0, 7.0, 8.0 };

struct z2
{
  float x[3];
};

struct z2 b = { 13.f, 14.f, 15.f };
struct z2 c = { 16.f, 17.f, 18.f };

#include "abitest.h"
#else

  ARG(struct z1, a, D0)
  ARG(double, 9.0, D4)
  ARG(double, 10.0, D5)
  ARG(struct z2, b, STACK)       /* [C.3] on stack and size padded to 16 bytes */
#ifndef __AAPCS64_BIG_ENDIAN__
  ARG(float, 15.5f, STACK+16)    /* [C.3] NSRN has been set to 8 */
#else
  ARG(float, 15.5f, STACK+20)
#endif
  LAST_ARG(struct z2, c, STACK+24)
#endif