Fix C++ template function matching in cooked index
[binutils-gdb.git] / gdb / testsuite / gdb.base / max-depth.c
blob7e46b134c109183684df070cf9ebc9e4e5416ade
1 /* This testcase is part of GDB, the GNU debugger.
3 Copyright 2019-2024 Free Software Foundation, Inc.
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.
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.
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/>. */
18 struct s1
20 int x;
21 int y;
22 } s1;
24 struct s2
26 int x;
27 int y;
28 struct
30 int z;
31 int a;
33 } s2;
35 struct s3
37 int x;
38 int y;
39 struct
41 int z;
42 int a;
43 struct
45 int b;
46 int c;
49 } s3;
51 struct s4
53 int x;
54 int y;
55 struct
57 int x;
58 int y;
59 struct
61 int x;
62 int y;
63 } l2;
64 } l1;
65 } s4;
67 struct s5
69 union
71 int raw[3];
72 struct
74 int x;
75 int y;
76 int z;
79 } s5;
81 typedef struct
83 union
85 int raw[3];
86 struct
88 int x;
89 int y;
90 int z;
93 } s6_t;
95 s6_t s6;
97 struct s7
99 struct
101 int x;
102 int y;
104 struct
106 int z;
107 int a;
109 struct
111 int b;
112 int c;
114 } s7;
116 struct s8
118 int x;
119 int y;
120 struct
122 int z;
123 int a;
124 struct
126 int b;
127 int c;
129 } d1;
130 } s8;
132 struct s9
134 int x;
135 int y;
136 struct
138 int k;
139 int j;
140 struct
142 int z;
143 int a;
144 struct
146 int b;
147 int c;
149 } d1;
151 struct
153 int z;
154 int a;
155 struct
157 int b;
158 int c;
160 } d2;
161 } s9;
163 struct s10
165 int x[10];
166 int y;
167 struct
169 int k[10];
170 int j;
171 struct
173 int z;
174 int a;
175 struct
177 int b[10];
178 int c;
180 } d1;
182 struct
184 int z;
185 int a;
186 struct
188 int b[10];
189 int c;
191 } d2;
192 } s10;
194 struct s11
196 int x;
197 char s[10];
198 struct
200 int z;
201 int a;
203 } s11;
205 /* The following are C++ inheritance testing. */
206 #ifdef __cplusplus
208 /* This is non-virtual inheritance. */
209 struct C1 { int c1 = 1; } c1;
210 struct C2 { int c2 = 2; } c2;
211 struct C3 : C2 { int c3 = 3; } c3;
212 struct C4 { int c4 = 4; } c4;
213 struct C5 : C4 { int c5 = 5; } c5;
214 struct C6 : C5 { int c6 = 6; } c6;
215 struct C7 : C1, C3, C6 { int c7 = 7; } c7;
217 /* This is virtual inheritance. */
218 struct V1 { int v1 = 1; } v1;
219 struct V2 : virtual V1 { int v2 = 2; } v2;
220 struct V3 : virtual V1 { int v3 = 3; } v3;
221 struct V4 : virtual V2 { int v4 = 4; } v4;
222 struct V5 : virtual V2 { int v5 = 1; } v5;
223 struct V6 : virtual V2, virtual V3 { int v6 = 1; } v6;
224 struct V7 : virtual V4, virtual V5, virtual V6 { int v7 = 1; } v7;
226 #endif /* __cplusplus */
228 void Do_nothing (struct s1 sone)
230 /* This Function does nothing. */
234 main ()
236 /* In targets like AIX, linker optimises out unused global
237 variables. The do_nothing () function stops the linker
238 from doing so. */
239 Do_nothing (s1);
240 return 0;