1 /* Test AAPCS64 layout.
3 Test the comformance to the alignment and padding requirements.
5 B.4 If the argument type is a Composite Type then the size of the
6 argument is rounded up to the nearest multiple of 8 bytes.
7 C.4 If the argument is an HFA, a Quad-precision Floating-point or Short
8 Vector Type then the NSAA is rounded up to the larger of 8 or the
9 Natural Alignment of the argument's type.
10 C.12 The NSAA is rounded up to the larger of 8 or the Natural Alignment
11 of the argument's type.
12 C.14 If the size of the argument is less than 8 bytes then the size of
13 the argument is set ot 8 bytes. The effect is as if the argument
14 was copied to the least significant bits of a 64-bit register and
15 the remaining bits filled with unspecified values. */
17 /* { dg-do run { target aarch64*-*-* } } */
20 #define TESTFILE "test_align-1.c"
31 struct y v1
= { 1, 2, 3, 4 };
32 struct y v2
= { 5, 6, 7, 8 };
33 struct y v3
= { 9, 10, 11, 12 };
34 struct y v4
= { 13, 14, 15, 16 };
41 struct z a
= { 5.0, 6.0, 7.0, 8.0 };
42 struct z b
= { 9.0, 10.0, 11.0, 12.0 };
44 vf4_t c
= { 13.f
, 14.f
, 15.f
, 16.f
};
70 } ldx2
= { 12345.67890L, 23456.78901L };
78 #define HAS_DATA_INIT_FUNC
81 w
.v
= (vf4_t
){ 17.f
, 18.f
, 19.f
, 20.f
};
100 ARG(double, 12.5, STACK
)
101 ARG(vf4_t
, c
, STACK
+16) /* [C.4] 16-byte aligned short vector */
102 ARG(double, 17.0, STACK
+32)
103 ARG(struct x
, w
, STACK
+48) /* [C.12] 16-byte aligned small struct */
104 #ifndef __AAPCS64_BIG_ENDIAN__
105 ARG(char, ch
, STACK
+64) /* [C.14] char padded to the size of 8 bytes */
106 ARG(short, sh
, STACK
+72) /* [C.14] short padded to the size of 8 bytes */
107 ARG(int, i
, STACK
+80) /* [C.14] int padded to the size of 8 bytes */
109 ARG(char, ch
, STACK
+71)
110 ARG(short, sh
, STACK
+78)
111 ARG(int, i
, STACK
+84)
113 ARG(long long, ll
, STACK
+88)
114 ARG(struct s1
, s1
, STACK
+96) /* [B.4] small struct padded to the size of 8 bytes */
115 ARG(double, 18.0, STACK
+104)
116 ARG(struct s2
, s2
, STACK
+112) /* [B.4] small struct padded to the size of 16 bytes */
117 ARG(double, 19.0, STACK
+128)
118 ARG(long double, 30.0L, STACK
+144) /* [C.4] 16-byte aligned quad-precision */
119 ARG(double, 31.0, STACK
+160)
120 ARG(struct ldx2_t
, ldx2
, STACK
+176) /* [C.4] 16-byte aligned HFA */
121 ARG(double, 32.0, STACK
+208)
122 ARG(__int128
, 33, STACK
+224) /* [C.12] 16-byte aligned 128-bit integer */
123 ARG(double, 34.0, STACK
+240)
124 ARG(union u_t
, u
, STACK
+256) /* [C.12] 16-byte aligned small composite (union in this case) */
125 LAST_ARG_NONFLAT (int, 35.0, STACK
+272, i32in64
)