Debian Codegraph @

gcc/testsuite/g++.target/aarch64/no_unique_address_1.C

raw
1 /* { dg-options "-std=c++11 -O -foptimize-sibling-calls -fpeephole2" } */
2 /* { dg-final { check-function-bodies "**" "" "" { target lp64 } } } */
3
4 struct X { };
5 struct Y { int : 0; };
6 struct Z { int : 0; Y y; };
7 struct W : public X { X q; };
8
9 struct A { float a; };
10
11 struct B : public X { float a; };
12 struct C : public Y { float a; };
13 struct D : public Z { float a; };
14 struct E : public W { float a; };
15
16 struct F { [[no_unique_address]] X x; float a; };
17 struct G { [[no_unique_address]] Y y; float a; };
18 struct H { [[no_unique_address]] Z z; float a; };
19 struct I { [[no_unique_address]] W w; float a; };
20
21 struct J { float a; [[no_unique_address]] X x; float b; };
22 struct K { float a; [[no_unique_address]] Y y; float b; };
23 struct L { float a; [[no_unique_address]] Z z; float b; };
24 struct M { float a; [[no_unique_address]] W w; float b; };
25
26 struct N : public A { float b; };
27 struct O { [[no_unique_address]] A a; float b; };
28
29 struct P : public Y { int : 0; float a, b, c, d; };
30
31 union Q { X x; float a; };
32 union R { [[no_unique_address]] X x; float a; };
33
34 union S { A a; float b; };
35 union T { F f; float b; };
36 union U { N n; O o; };
37
38 typedef S Salias;
39 typedef T Talias;
40 typedef U Ualias;
41
42 #define T(S, s) extern int callee_##s (S)
43
44 /*
45 ** _Z8caller_aR1A:
46 ** ldr s0, \[x0\]
47 ** b .*
48 */
49 T (A, a); int caller_a (A &a) { return callee_a (a); } /* { dg-bogus {argument of type 'A'} } */
50
51 /*
52 ** _Z8caller_bR1B:
53 ** ldr s0, \[x0\]
54 ** b .*
55 */
56 T (B, b); int caller_b (B &b) { return callee_b (b); } /* { dg-bogus {argument of type 'B'} } */
57
58 /*
59 ** _Z8caller_cR1C:
60 ** ldr s0, \[x0\]
61 ** b .*
62 */
63 T (C, c); int caller_c (C &c) { return callee_c (c); } /* { dg-bogus {argument of type 'C'} } */
64
65 /*
66 ** _Z8caller_dR1D:
67 ** ldr x0, \[x0\]
68 ** b .*
69 */
70 T (D, d); int caller_d (D &d) { return callee_d (d); } /* { dg-bogus {argument of type 'D'} } */
71
72 /*
73 ** _Z8caller_eR1E:
74 ** ldr x0, \[x0\]
75 ** b .*
76 */
77 T (E, e); int caller_e (E &e) { return callee_e (e); } /* { dg-bogus {argument of type 'E'} } */
78
79 /*
80 ** _Z8caller_fR1F:
81 ** ldr s0, \[x0\]
82 ** b .*
83 */
84 T (F, f); int caller_f (F &f) { return callee_f (f); } /* { dg-message {parameter passing for argument of type 'F' with '\[\[no_unique_address\]\]' members changed in GCC 10.1} } */
85
86 /*
87 ** _Z8caller_gR1G:
88 ** ldr s0, \[x0\]
89 ** b .*
90 */
91 T (G, g); int caller_g (G &g) { return callee_g (g); } /* { dg-message {parameter passing for argument of type 'G' with '\[\[no_unique_address\]\]' members changed in GCC 10.1} } */
92
93 /*
94 ** _Z8caller_hR1H:
95 ** ldr x0, \[x0\]
96 ** b .*
97 */
98 T (H, h); int caller_h (H &h) { return callee_h (h); } /* { dg-bogus {argument of type 'H'} } */
99
100 /*
101 ** _Z8caller_iR1I:
102 ** ldr x0, \[x0\]
103 ** b .*
104 */
105 T (I, i); int caller_i (I &i) { return callee_i (i); } /* { dg-bogus {argument of type 'I'} } */
106
107 /*
108 ** _Z8caller_jR1J:
109 ** ldp s0, s1, \[x0\]
110 ** b .*
111 */
112 T (J, j); int caller_j (J &j) { return callee_j (j); } /* { dg-message {parameter passing for argument of type 'J' with '\[\[no_unique_address\]\]' members changed in GCC 10.1} } */
113
114 /*
115 ** _Z8caller_kR1K:
116 ** ldp s0, s1, \[x0\]
117 ** b .*
118 */
119 T (K, k); int caller_k (K &k) { return callee_k (k); } /* { dg-message {parameter passing for argument of type 'K' with '\[\[no_unique_address\]\]' members changed in GCC 10.1} } */
120
121 /*
122 ** _Z8caller_lR1L: { target aarch64_little_endian }
123 ** (
124 ** ldr w1, \[x0, 8\]
125 ** ldr x0, \[x0\]
126 ** |
127 ** mov (x[0-9]+), x0
128 ** ldr x0, \[x0\]
129 ** ldr w1, \[\1, 8\]
130 ** )
131 ** b .*
132 */
133 T (L, l); int caller_l (L &l) { return callee_l (l); } /* { dg-bogus {argument of type 'L'} } */
134
135 /*
136 ** _Z8caller_mR1M: { target aarch64_little_endian }
137 ** (
138 ** ldr w1, \[x0, 8\]
139 ** ldr x0, \[x0\]
140 ** |
141 ** mov (x[0-9]+), x0
142 ** ldr x0, \[x0\]
143 ** ldr w1, \[\1, 8\]
144 ** )
145 ** b .*
146 */
147 T (M, m); int caller_m (M &m) { return callee_m (m); } /* { dg-bogus {argument of type 'M'} } */
148
149 /*
150 ** _Z8caller_nR1N:
151 ** ldp s0, s1, \[x0\]
152 ** b .*
153 */
154 T (N, n); int caller_n (N &n) { return callee_n (n); } /* { dg-bogus {argument of type 'N'} } */
155
156 /*
157 ** _Z8caller_oR1O:
158 ** ldp s0, s1, \[x0\]
159 ** b .*
160 */
161 T (O, o); int caller_o (O &o) { return callee_o (o); } /* { dg-bogus {argument of type 'O'} } */
162
163 /*
164 ** _Z8caller_pR1P:
165 ** ldp s0, s1, \[x0\]
166 ** ldp s2, s3, \[x0, 8\]
167 ** b .*
168 */
169 T (P, p); int caller_p (P &p) { return callee_p (p); } /* { dg-bogus {argument of type 'P'} } */
170
171 /*
172 ** _Z8caller_qR1Q: { target aarch64_little_endian }
173 ** ldr w0, \[x0\]
174 ** b .*
175 */
176 T (Q, q); int caller_q (Q &q) { return callee_q (q); } /* { dg-bogus {argument of type 'Q'} } */
177
178 /*
179 ** _Z8caller_rR1R: { target aarch64_little_endian }
180 ** ldr w0, \[x0\]
181 ** b .*
182 */
183 T (R, r); int caller_r (R &r) { return callee_r (r); } /* { dg-bogus {argument of type 'R'} } */
184
185 /*
186 ** _Z8caller_sR1S:
187 ** ldr s0, \[x0\]
188 ** b .*
189 */
190 T (Salias, s); int caller_s (Salias &s) { return callee_s (s); } /* { dg-bogus {argument of type 'S'} } */
191
192 /*
193 ** _Z8caller_tR1T:
194 ** ldr s0, \[x0\]
195 ** b .*
196 */
197 T (Talias, t); int caller_t (Talias &t) { return callee_t (t); } /* { dg-message {parameter passing for argument of type 'T' with '\[\[no_unique_address\]\]' members changed in GCC 10.1} } */
198
199 /*
200 ** _Z8caller_uR1U:
201 ** ldp s0, s1, \[x0\]
202 ** b .*
203 */
204 T (Ualias, u); int caller_u (Ualias &u) { return callee_u (u); } /* { dg-bogus {argument of type 'U'} } */
205
206 /* { dg-bogus {argument of type 'const} "should not be printed as const" { target *-*-*} 0 } */