Automatic Copyright Year update after running gdb/copyright.py
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / infcall-nested-structs.c
CommitLineData
dbbb1059
AB
1/* This testcase is part of GDB, the GNU debugger.
2
88b9d363 3 Copyright 2018-2022 Free Software Foundation, Inc.
dbbb1059
AB
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17
18/* This file is used for testing GDBs ability to pass structures to, and
19 return structures from, functions. All of the structures in this test
36eb4c5f 20 are special in that they are small structures containing from 1 up to 5
dbbb1059
AB
21 scalar fields, the fields can be inside nested structures, and there can
22 be empty structures around too.
23
353229bf
AH
24 When compiled for C++ this file also tests structures containing static
25 members (which live in global memory). In addition, empty structures in C++
26 have a size of 1 (compared to 0 in GNU C), which can effect structure
27 padding.
28
36eb4c5f
AH
29 This test is specifically written for RiscV and Aarch64, which both have
30 special ABI rules for structures like these, however, there should be no harm
31 in running these tests on other targets, though in many cases the
dbbb1059
AB
32 structures will treated no differently to the structures already covered
33 in the structs.exp test script. */
34
35#include <string.h>
7ea44a51 36#include "../lib/attributes.h"
dbbb1059
AB
37
38/* Useful abreviations. */
39typedef char tc;
40typedef short ts;
41typedef int ti;
42typedef long tl;
43typedef long long tll;
44typedef float tf;
45typedef double td;
46typedef long double tld;
47
48#ifdef TEST_COMPLEX
49typedef float _Complex tfc;
50typedef double _Complex tdc;
51typedef long double _Complex tldc;
52#endif /* TEST_COMPLEX */
53
54#define MAKE_CHECK_FUNCS(TYPE) \
7ea44a51 55 int __attribute__((noinline)) ATTRIBUTE_NOCLONE \
dbbb1059
AB
56 check_arg_ ## TYPE (struct TYPE arg) \
57 { \
58 return cmp_ ## TYPE (arg, ref_val_ ## TYPE); \
59 } \
60 \
7ea44a51 61 struct TYPE __attribute__((noinline)) ATTRIBUTE_NOCLONE \
dbbb1059
AB
62 rtn_str_ ## TYPE (void) \
63 { \
64 return (ref_val_ ## TYPE); \
65 }
66
67#define REF_VAL(NAME) struct NAME ref_val_ ## NAME
68#define ES(NAME) struct { } NAME
69
36eb4c5f 70/* Test is either for a single type or two differing types. */
dbbb1059 71#if defined tA && ! defined tB
36eb4c5f
AH
72#define tB tA
73#endif
74#if ! defined tB
75#error "Incorrect configuration of tA and tB defines"
76#endif
dbbb1059
AB
77
78/* Structures with a single field nested to various depths, along with
79 some empty structures. */
36eb4c5f
AH
80struct struct_01_01 { ES(es1); struct { struct { tA a; } s1; } s2; };
81struct struct_01_02 { tA a; struct { struct { ES(es1); } s1; } s2; };
82struct struct_01_03 { struct { struct { ES(es1); } s1; } s2; ES(es1); struct { struct { tA a; } s3; } s4;};
83struct struct_01_04 { ES(es1); ES(es2); tA a; ES(es3); };
84
85/* Structures with two fields nested to various depths, along with
86 some empty structures. */
87struct struct_02_01 { ES(es1); struct { struct { tA a; tB b; } s1; } s2; };
88struct struct_02_02 { tA a; struct { struct { ES(es1); } s1; } s2; tB b; };
89struct struct_02_03 { struct { struct { ES(es1); } s1; } s2; ES(es1); struct { struct { tA a; } s3; } s4; struct { struct { tB b; } s5; } s6;};
90struct struct_02_04 { ES(es1); ES(es2); tA a; ES(es3); tB b; };
91
92/* Structures with four fields nested to various depths, along with
93 some empty structures. */
94struct struct_04_01 { ES(es1); struct { struct { tA a; tB b; tA c; tB d; } s1; } s2; };
95struct struct_04_02 { tA a; struct { struct { ES(es1); } s1; } s2; tB b; struct { struct { ES(es1); } s2; } s3; tA c; struct { struct { ES(es2); } s4; } s5; tB d;};
96struct struct_04_03 { struct { struct { ES(es1); } s1; } s2; ES(es1); struct { struct { tA a; } s3; } s4; struct { struct { tB b; } s5; } s6; struct { struct { tA c; } s7; } s8; struct { struct { tB d; } s9; } s10;};
97struct struct_04_04 { ES(es1); ES(es2); tA a; ES(es3); tB b; ES(es4); tA c; ES(es5); tB d; };
98
99/* Structures with five fields nested to various depths, along with
100 some empty structures. */
101struct struct_05_01 { ES(es1); struct { struct { tA a; tB b; tA c; tB d; tA e; } s1; } s2; };
102struct struct_05_02 { tA a; struct { struct { ES(es1); } s1; } s2; tB b; struct { struct { ES(es1); } s2; } s3; tA c; struct { struct { ES(es2); } s4; } s5; tB d; struct { struct { ES(es2); } s6; } s7; tB e;};
103struct struct_05_03 { struct { struct { ES(es1); } s1; } s2; ES(es1); struct { struct { tA a; } s3; } s4; struct { struct { tB b; } s5; } s6; struct { struct { tA c; } s7; } s8; struct { struct { tB d; } s9; } s10; struct { struct { tA e; } s11; } s12;};
104struct struct_05_04 { ES(es1); ES(es2); tA a; ES(es3); tB b; ES(es4); tA c; ES(es5); tB d; ES(es6); tA e; };
dbbb1059 105
353229bf
AH
106/* Only C++ allows structures to have static members. */
107#ifdef __cplusplus
108
109/* Structures with two fields nested to various depths, one of which is static.
110 Some include empty structures. */
111struct struct_static_02_01 { struct sa { struct sb { tA a; static tB b; } s1; } s2; };
112struct struct_static_02_02 { static tA a; struct { struct { ES(es1); } s1; } s2; tB b; };
113struct struct_static_02_03 { struct { struct { ES(es1); } s1; } s2; ES(es1); struct { struct { tA a; } s3; } s4; struct sa { struct sb { static tB b; } s5; } s6;};
114struct struct_static_02_04 { static tA a; tB b; };
115
116/* Structures with four fields nested to various depths, some of which are
117 static. Some include empty structures. */
118struct struct_static_04_01 { struct sa { struct sb { static tA a; tB b; tA c; tB d; } s1; } s2; };
119struct struct_static_04_02 { tA a; struct { struct { ES(es1); } s1; } s2; tB b; struct { struct { ES(es1); } s2; } s3; static tA c; struct { struct { ES(es2); } s4; } s5; static tB d;};
120struct struct_static_04_03 { struct sa { struct sb { static tA a; } s3; } s4; struct sc { struct sd { static tB b; } s5; } s6; struct se { struct sf { static tA c; } s7; } s8; struct sg { struct sh { static tB d; } s9; } s10;};
121struct struct_static_04_04 { ES(es1); ES(es2); tA a; ES(es3); tB b; ES(es4); tA c; ES(es5); static tB d; };
122
123/* Structures with six fields nested to various depths, some of which are
124 static. Some include empty structures. */
125struct struct_static_06_01 { struct sa { struct sb { tA a; static tB b; tA c; tB d; tA e; } s1; } s2; tB f; };
126struct struct_static_06_02 { tA a; static tB b; static tA c; tB d; tB e; tA f;};
127struct struct_static_06_03 { struct { struct { ES(es1); } s1; } s2; ES(es1); struct sa { struct sb { static tA a; } s3; } s4; struct sc { struct sd { tB b; } s5; } s6; struct se { struct sf { static tA c; } s7; } s8; struct sg { struct sh { static tB d; } s9; } s10; struct { struct { tA e; tB f; } s11; } s12;};
128struct struct_static_06_04 { ES(es1); ES(es2); static tA a; ES(es3); static tB b; ES(es4); static tA c; ES(es5); static tB d; ES(es6); static tA e; ES(es7); tB f; };
129
130#endif
131
7ea44a51 132int __attribute__((noinline)) ATTRIBUTE_NOCLONE
94cb3754 133cmp_struct_01_01 (struct struct_01_01 a, struct struct_01_01 b)
dbbb1059
AB
134{ return a.s2.s1.a == b.s2.s1.a; }
135
7ea44a51 136int __attribute__((noinline)) ATTRIBUTE_NOCLONE
94cb3754 137cmp_struct_01_02 (struct struct_01_02 a, struct struct_01_02 b)
dbbb1059
AB
138{ return a.a == b.a; }
139
7ea44a51 140int __attribute__((noinline)) ATTRIBUTE_NOCLONE
94cb3754 141cmp_struct_01_03 (struct struct_01_03 a, struct struct_01_03 b)
dbbb1059
AB
142{ return a.s4.s3.a == b.s4.s3.a; }
143
7ea44a51 144int __attribute__((noinline)) ATTRIBUTE_NOCLONE
94cb3754 145cmp_struct_01_04 (struct struct_01_04 a, struct struct_01_04 b)
dbbb1059
AB
146{ return a.a == b.a; }
147
7ea44a51 148int __attribute__((noinline)) ATTRIBUTE_NOCLONE
94cb3754 149cmp_struct_02_01 (struct struct_02_01 a, struct struct_02_01 b)
6dfc0041 150{ return a.s2.s1.a == b.s2.s1.a && a.s2.s1.b == b.s2.s1.b; }
dbbb1059 151
7ea44a51 152int __attribute__((noinline)) ATTRIBUTE_NOCLONE
94cb3754 153cmp_struct_02_02 (struct struct_02_02 a, struct struct_02_02 b)
36eb4c5f 154{ return a.a == b.a && a.b == b.b; }
dbbb1059 155
7ea44a51 156int __attribute__((noinline)) ATTRIBUTE_NOCLONE
94cb3754 157cmp_struct_02_03 (struct struct_02_03 a, struct struct_02_03 b)
36eb4c5f 158{ return a.s4.s3.a == b.s4.s3.a && a.s6.s5.b == b.s6.s5.b; }
dbbb1059 159
7ea44a51 160int __attribute__((noinline)) ATTRIBUTE_NOCLONE
94cb3754 161cmp_struct_02_04 (struct struct_02_04 a, struct struct_02_04 b)
36eb4c5f 162{ return a.a == b.a && a.b == b.b; }
dbbb1059 163
7ea44a51 164int __attribute__((noinline)) ATTRIBUTE_NOCLONE
94cb3754 165cmp_struct_04_01 (struct struct_04_01 a, struct struct_04_01 b)
6dfc0041
AA
166{ return a.s2.s1.a == b.s2.s1.a && a.s2.s1.b == b.s2.s1.b
167 && a.s2.s1.c == b.s2.s1.c && a.s2.s1.d == b.s2.s1.d; }
dbbb1059 168
7ea44a51 169int __attribute__((noinline)) ATTRIBUTE_NOCLONE
94cb3754 170cmp_struct_04_02 (struct struct_04_02 a, struct struct_04_02 b)
36eb4c5f 171{ return a.a == b.a && a.b == b.b && a.c == b.c && a.d == b.d; }
dbbb1059 172
7ea44a51 173int __attribute__((noinline)) ATTRIBUTE_NOCLONE
94cb3754 174cmp_struct_04_03 (struct struct_04_03 a, struct struct_04_03 b)
36eb4c5f
AH
175{ return a.s4.s3.a == b.s4.s3.a && a.s6.s5.b == b.s6.s5.b
176 && a.s8.s7.c == b.s8.s7.c && a.s10.s9.d == b.s10.s9.d; }
dbbb1059 177
7ea44a51 178int __attribute__((noinline)) ATTRIBUTE_NOCLONE
94cb3754 179cmp_struct_04_04 (struct struct_04_04 a, struct struct_04_04 b)
36eb4c5f 180{ return a.a == b.a && a.b == b.b && a.c == b.c && a.d == b.d; }
dbbb1059 181
7ea44a51 182int __attribute__((noinline)) ATTRIBUTE_NOCLONE
94cb3754 183cmp_struct_05_01 (struct struct_05_01 a, struct struct_05_01 b)
6dfc0041
AA
184{ return a.s2.s1.a == b.s2.s1.a && a.s2.s1.b == b.s2.s1.b
185 && a.s2.s1.c == b.s2.s1.c && a.s2.s1.d == b.s2.s1.d
36eb4c5f 186 && a.s2.s1.e == b.s2.s1.e; }
dbbb1059 187
7ea44a51 188int __attribute__((noinline)) ATTRIBUTE_NOCLONE
94cb3754 189cmp_struct_05_02 (struct struct_05_02 a, struct struct_05_02 b)
36eb4c5f 190{ return a.a == b.a && a.b == b.b && a.c == b.c && a.d == b.d && a.e == b.e; }
dbbb1059 191
7ea44a51 192int __attribute__((noinline)) ATTRIBUTE_NOCLONE
94cb3754 193cmp_struct_05_03 (struct struct_05_03 a, struct struct_05_03 b)
36eb4c5f
AH
194{ return a.s4.s3.a == b.s4.s3.a && a.s6.s5.b == b.s6.s5.b
195 && a.s8.s7.c == b.s8.s7.c && a.s10.s9.d == b.s10.s9.d
196 && a.s12.s11.e == b.s12.s11.e; }
197
7ea44a51 198int __attribute__((noinline)) ATTRIBUTE_NOCLONE
94cb3754 199cmp_struct_05_04 (struct struct_05_04 a, struct struct_05_04 b)
36eb4c5f
AH
200{ return a.a == b.a && a.b == b.b && a.c == b.c && a.d == b.d && a.e == b.e; }
201
353229bf
AH
202#ifdef __cplusplus
203
7ea44a51 204int __attribute__((noinline)) ATTRIBUTE_NOCLONE
353229bf
AH
205cmp_struct_static_02_01 (struct struct_static_02_01 a,
206 struct struct_static_02_01 b)
6dfc0041 207{ return a.s2.s1.a == b.s2.s1.a && a.s2.s1.b == b.s2.s1.b; }
353229bf 208
7ea44a51 209int __attribute__((noinline)) ATTRIBUTE_NOCLONE
353229bf
AH
210cmp_struct_static_02_02 (struct struct_static_02_02 a,
211 struct struct_static_02_02 b)
212{ return a.a == b.a && a.b == b.b; }
213
7ea44a51 214int __attribute__((noinline)) ATTRIBUTE_NOCLONE
353229bf
AH
215cmp_struct_static_02_03 (struct struct_static_02_03 a,
216 struct struct_static_02_03 b)
217{ return a.s4.s3.a == b.s4.s3.a && a.s6.s5.b == b.s6.s5.b; }
218
7ea44a51 219int __attribute__((noinline)) ATTRIBUTE_NOCLONE
353229bf
AH
220cmp_struct_static_02_04 (struct struct_static_02_04 a,
221 struct struct_static_02_04 b)
222{ return a.a == b.a && a.b == b.b; }
223
7ea44a51 224int __attribute__((noinline)) ATTRIBUTE_NOCLONE
353229bf
AH
225cmp_struct_static_04_01 (struct struct_static_04_01 a,
226 struct struct_static_04_01 b)
6dfc0041
AA
227{ return a.s2.s1.a == b.s2.s1.a && a.s2.s1.b == b.s2.s1.b
228 && a.s2.s1.c == b.s2.s1.c && a.s2.s1.d == b.s2.s1.d; }
353229bf 229
7ea44a51 230int __attribute__((noinline)) ATTRIBUTE_NOCLONE
353229bf
AH
231cmp_struct_static_04_02 (struct struct_static_04_02 a,
232 struct struct_static_04_02 b)
233{ return a.a == b.a && a.b == b.b && a.c == b.c && a.d == b.d; }
234
7ea44a51 235int __attribute__((noinline)) ATTRIBUTE_NOCLONE
353229bf
AH
236cmp_struct_static_04_03 (struct struct_static_04_03 a,
237 struct struct_static_04_03 b)
238{ return a.s4.s3.a == b.s4.s3.a && a.s6.s5.b == b.s6.s5.b
239 && a.s8.s7.c == b.s8.s7.c && a.s10.s9.d == b.s10.s9.d; }
240
7ea44a51 241int __attribute__((noinline)) ATTRIBUTE_NOCLONE
353229bf
AH
242cmp_struct_static_04_04 (struct struct_static_04_04 a,
243 struct struct_static_04_04 b)
244{ return a.a == b.a && a.b == b.b && a.c == b.c && a.d == b.d; }
245
7ea44a51 246int __attribute__((noinline)) ATTRIBUTE_NOCLONE
353229bf
AH
247cmp_struct_static_06_01 (struct struct_static_06_01 a,
248 struct struct_static_06_01 b)
6dfc0041
AA
249{ return a.s2.s1.a == b.s2.s1.a && a.s2.s1.b == b.s2.s1.b
250 && a.s2.s1.c == b.s2.s1.c && a.s2.s1.d == b.s2.s1.d
353229bf
AH
251 && a.s2.s1.e == b.s2.s1.e && a.f == b.f; }
252
7ea44a51 253int __attribute__((noinline)) ATTRIBUTE_NOCLONE
353229bf
AH
254cmp_struct_static_06_02 (struct struct_static_06_02 a,
255 struct struct_static_06_02 b)
256{ return a.a == b.a && a.b == b.b && a.c == b.c && a.d == b.d && a.e == b.e
257 && a.f == b.f; }
258
7ea44a51 259int __attribute__((noinline)) ATTRIBUTE_NOCLONE
353229bf
AH
260cmp_struct_static_06_03 (struct struct_static_06_03 a,
261 struct struct_static_06_03 b)
262{ return a.s4.s3.a == b.s4.s3.a && a.s6.s5.b == b.s6.s5.b
263 && a.s8.s7.c == b.s8.s7.c && a.s10.s9.d == b.s10.s9.d
264 && a.s12.s11.e == b.s12.s11.e && a.s12.s11.f == b.s12.s11.f; }
265
7ea44a51 266int __attribute__((noinline)) ATTRIBUTE_NOCLONE
353229bf
AH
267cmp_struct_static_06_04 (struct struct_static_06_04 a,
268 struct struct_static_06_04 b)
269{ return a.a == b.a && a.b == b.b && a.c == b.c && a.d == b.d && a.e == b.e
270 && a.f == b.f; }
271
272#endif
273
36eb4c5f
AH
274REF_VAL(struct_01_01) = { {}, { { 'a' } } };
275REF_VAL(struct_01_02) = { 'a', { { {} } } };
276REF_VAL(struct_01_03) = { { { {} } }, {}, { { 'a' } } };
277REF_VAL(struct_01_04) = { {}, {}, 'a', {} };
278
279REF_VAL(struct_02_01) = { {}, { { 'a', 'b' } } };
280REF_VAL(struct_02_02) = { 'a', { { {} } }, 'b' };
281REF_VAL(struct_02_03) = { { { {} } }, {}, { { 'a' } }, { { 'b' } } };
282REF_VAL(struct_02_04) = { {}, {}, 'a', {}, 'b' };
283
284REF_VAL(struct_04_01) = { {}, { { 'a', 'b', 'c', 'd' } } };
285REF_VAL(struct_04_02) = { 'a', { { {} } }, 'b', { { {} } }, 'c', { { {} } }, 'd' };
286REF_VAL(struct_04_03) = { { { {} } }, {}, { { 'a' } }, { { 'b' } }, { { 'c' } }, { { 'd' } } };
287REF_VAL(struct_04_04) = { {}, {}, 'a', {}, 'b', {}, 'c', {}, 'd' };
288
289REF_VAL(struct_05_01) = { {}, { { 'a', 'b', 'c', 'd', 'e' } } };
290REF_VAL(struct_05_02) = { 'a', { { {} } }, 'b', { { {} } }, 'c', { { {} } }, 'd', { { {} } }, 'e' };
291REF_VAL(struct_05_03) = { { { {} } }, {}, { { 'a' } }, { { 'b' } }, { { 'c' } }, { { 'd' } }, { { 'e' } } };
292REF_VAL(struct_05_04) = { {}, {}, 'a', {}, 'b', {}, 'c', {}, 'd', {}, 'e' };
dbbb1059 293
353229bf
AH
294#ifdef __cplusplus
295
296/* Initialise static members. */
297tB struct_static_02_01::sa::sb::b = '1';
298tA struct_static_02_02::a = '2';
299tB struct_static_02_03::sa::sb::b = '3';
300tA struct_static_02_04::a = '4';
301tA struct_static_04_01::sa::sb::a = '5';
302tA struct_static_04_02::c = '6';
303tB struct_static_04_02::d = '7';
304tA struct_static_04_03::sa::sb::a = '8';
305tB struct_static_04_03::sc::sd::b = '9';
306tA struct_static_04_03::se::sf::c = '0';
307tB struct_static_04_03::sg::sh::d = 'A';
308tB struct_static_04_04::d = 'B';
309tB struct_static_06_01::sa::sb::b = 'C';
310tB struct_static_06_02::b = 'D';
311tA struct_static_06_02::c = 'E';
312tA struct_static_06_03::sa::sb::a = 'F';
313tA struct_static_06_03::se::sf::c = 'G';
314tB struct_static_06_03::sg::sh::d = 'H';
315tA struct_static_06_04::a = 'I';
316tB struct_static_06_04::b = 'J';
317tA struct_static_06_04::c = 'K';
318tB struct_static_06_04::d = 'L';
319tA struct_static_06_04::e = 'M';
320
321REF_VAL(struct_static_02_01) = { { { 'a' } } };
322REF_VAL(struct_static_02_02) = { { { {} } }, 'b' };
323REF_VAL(struct_static_02_03) = { { { {} } }, {}, { { 'a' } }, { { } } };
324REF_VAL(struct_static_02_04) = { 'b' };
325REF_VAL(struct_static_04_01) = { { { 'b', 'c', 'd' } } };
326REF_VAL(struct_static_04_02) = { 'a', { { {} } }, 'b', { { {} } }, { { {} } } };
327REF_VAL(struct_static_04_03) = {};
328REF_VAL(struct_static_04_04) = { {}, {}, 'a', {}, 'b', {}, 'c', {} };
329REF_VAL(struct_static_06_01) = { { { 'a', 'c', 'd', 'e' } }, 'f' };
330REF_VAL(struct_static_06_02) = { 'a', 'd', 'e', 'f' };
331REF_VAL(struct_static_06_03) = { { { {} } }, {}, {}, { { 'b' } }, {}, /*{ { 'e', 'f' } }*/ };
332REF_VAL(struct_static_06_04) = { {}, {}, {}, {}, {}, {}, {}, 'f' };
333
334#endif
335
dbbb1059 336/* Create all of the functions GDB will call to check functionality. */
36eb4c5f
AH
337MAKE_CHECK_FUNCS(struct_01_01)
338MAKE_CHECK_FUNCS(struct_01_02)
339MAKE_CHECK_FUNCS(struct_01_03)
340MAKE_CHECK_FUNCS(struct_01_04)
341MAKE_CHECK_FUNCS(struct_02_01)
342MAKE_CHECK_FUNCS(struct_02_02)
343MAKE_CHECK_FUNCS(struct_02_03)
344MAKE_CHECK_FUNCS(struct_02_04)
345MAKE_CHECK_FUNCS(struct_04_01)
346MAKE_CHECK_FUNCS(struct_04_02)
347MAKE_CHECK_FUNCS(struct_04_03)
348MAKE_CHECK_FUNCS(struct_04_04)
349MAKE_CHECK_FUNCS(struct_05_01)
350MAKE_CHECK_FUNCS(struct_05_02)
351MAKE_CHECK_FUNCS(struct_05_03)
352MAKE_CHECK_FUNCS(struct_05_04)
353229bf
AH
353#ifdef __cplusplus
354MAKE_CHECK_FUNCS(struct_static_02_01)
355MAKE_CHECK_FUNCS(struct_static_02_02)
356MAKE_CHECK_FUNCS(struct_static_02_03)
357MAKE_CHECK_FUNCS(struct_static_02_04)
358MAKE_CHECK_FUNCS(struct_static_04_01)
359MAKE_CHECK_FUNCS(struct_static_04_02)
360MAKE_CHECK_FUNCS(struct_static_04_03)
361MAKE_CHECK_FUNCS(struct_static_04_04)
362MAKE_CHECK_FUNCS(struct_static_06_01)
363MAKE_CHECK_FUNCS(struct_static_06_02)
364MAKE_CHECK_FUNCS(struct_static_06_03)
365MAKE_CHECK_FUNCS(struct_static_06_04)
366#endif
dbbb1059
AB
367
368#define CALL_LINE(NAME) val += check_arg_ ## NAME (rtn_str_ ## NAME ())
369
7ea44a51 370int __attribute__((noinline)) ATTRIBUTE_NOCLONE
dbbb1059
AB
371call_all ()
372{
94cb3754 373 int val = 0;
dbbb1059 374
36eb4c5f
AH
375 CALL_LINE(struct_01_01);
376 CALL_LINE(struct_01_02);
377 CALL_LINE(struct_01_03);
378 CALL_LINE(struct_01_04);
379 CALL_LINE(struct_02_01);
380 CALL_LINE(struct_02_02);
381 CALL_LINE(struct_02_03);
382 CALL_LINE(struct_02_04);
383 CALL_LINE(struct_04_01);
384 CALL_LINE(struct_04_02);
385 CALL_LINE(struct_04_03);
386 CALL_LINE(struct_04_04);
387 CALL_LINE(struct_05_01);
388 CALL_LINE(struct_05_02);
389 CALL_LINE(struct_05_03);
390 CALL_LINE(struct_05_04);
353229bf
AH
391#ifdef __cplusplus
392 CALL_LINE(struct_static_02_01);
393 CALL_LINE(struct_static_02_02);
394 CALL_LINE(struct_static_02_03);
395 CALL_LINE(struct_static_02_04);
396 CALL_LINE(struct_static_04_01);
397 CALL_LINE(struct_static_04_02);
398 CALL_LINE(struct_static_04_03);
399 CALL_LINE(struct_static_04_04);
400 CALL_LINE(struct_static_06_01);
401 CALL_LINE(struct_static_06_02);
402 CALL_LINE(struct_static_06_03);
403 CALL_LINE(struct_static_06_04);
404#endif
dbbb1059 405
94cb3754 406 return val;
dbbb1059
AB
407}
408
94cb3754
TV
409int volatile v = 1;
410
7ea44a51 411void __attribute__((noinline)) ATTRIBUTE_NOCLONE
dbbb1059
AB
412breakpt (void)
413{
94cb3754 414 v++;
dbbb1059
AB
415}
416
417int
418main ()
419{
420 int res;
421
422 res = call_all ();
423 breakpt (); /* Break Here. */
424 return res;
425}
This page took 0.596553 seconds and 4 git commands to generate.