Commit | Line | Data |
---|---|---|
2e62ab40 AB |
1 | /* This testcase is part of GDB, the GNU debugger. |
2 | ||
b811d2c2 | 3 | Copyright 2019-2020 Free Software Foundation, Inc. |
2e62ab40 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 | struct s1 | |
19 | { | |
20 | int x; | |
21 | int y; | |
22 | } s1; | |
23 | ||
24 | struct s2 | |
25 | { | |
26 | int x; | |
27 | int y; | |
28 | struct | |
29 | { | |
30 | int z; | |
31 | int a; | |
32 | }; | |
33 | } s2; | |
34 | ||
35 | struct s3 | |
36 | { | |
37 | int x; | |
38 | int y; | |
39 | struct | |
40 | { | |
41 | int z; | |
42 | int a; | |
43 | struct | |
44 | { | |
45 | int b; | |
46 | int c; | |
47 | }; | |
48 | }; | |
49 | } s3; | |
50 | ||
51 | struct s4 | |
52 | { | |
53 | int x; | |
54 | int y; | |
55 | struct | |
56 | { | |
57 | int x; | |
58 | int y; | |
59 | struct | |
60 | { | |
61 | int x; | |
62 | int y; | |
63 | } l2; | |
64 | } l1; | |
65 | } s4; | |
66 | ||
67 | struct s5 | |
68 | { | |
69 | union | |
70 | { | |
71 | int raw[3]; | |
72 | struct | |
73 | { | |
74 | int x; | |
75 | int y; | |
76 | int z; | |
77 | }; | |
78 | }; | |
79 | } s5; | |
80 | ||
81 | typedef struct | |
82 | { | |
83 | union | |
84 | { | |
85 | int raw[3]; | |
86 | struct | |
87 | { | |
88 | int x; | |
89 | int y; | |
90 | int z; | |
91 | }; | |
92 | }; | |
93 | } s6_t; | |
94 | ||
95 | s6_t s6; | |
96 | ||
97 | struct s7 | |
98 | { | |
99 | struct | |
100 | { | |
101 | int x; | |
102 | int y; | |
103 | }; | |
104 | struct | |
105 | { | |
106 | int z; | |
107 | int a; | |
108 | }; | |
109 | struct | |
110 | { | |
111 | int b; | |
112 | int c; | |
113 | }; | |
114 | } s7; | |
115 | ||
116 | struct s8 | |
117 | { | |
118 | int x; | |
119 | int y; | |
120 | struct | |
121 | { | |
122 | int z; | |
123 | int a; | |
124 | struct | |
125 | { | |
126 | int b; | |
127 | int c; | |
128 | }; | |
129 | } d1; | |
130 | } s8; | |
131 | ||
132 | struct s9 | |
133 | { | |
134 | int x; | |
135 | int y; | |
136 | struct | |
137 | { | |
138 | int k; | |
139 | int j; | |
140 | struct | |
141 | { | |
142 | int z; | |
143 | int a; | |
144 | struct | |
145 | { | |
146 | int b; | |
147 | int c; | |
148 | }; | |
149 | } d1; | |
150 | }; | |
151 | struct | |
152 | { | |
153 | int z; | |
154 | int a; | |
155 | struct | |
156 | { | |
157 | int b; | |
158 | int c; | |
159 | }; | |
160 | } d2; | |
161 | } s9; | |
162 | ||
163 | struct s10 | |
164 | { | |
165 | int x[10]; | |
166 | int y; | |
167 | struct | |
168 | { | |
169 | int k[10]; | |
170 | int j; | |
171 | struct | |
172 | { | |
173 | int z; | |
174 | int a; | |
175 | struct | |
176 | { | |
177 | int b[10]; | |
178 | int c; | |
179 | }; | |
180 | } d1; | |
181 | }; | |
182 | struct | |
183 | { | |
184 | int z; | |
185 | int a; | |
186 | struct | |
187 | { | |
188 | int b[10]; | |
189 | int c; | |
190 | }; | |
191 | } d2; | |
192 | } s10; | |
193 | ||
194 | struct s11 | |
195 | { | |
196 | int x; | |
197 | char s[10]; | |
198 | struct | |
199 | { | |
200 | int z; | |
201 | int a; | |
202 | }; | |
203 | } s11; | |
204 | ||
205 | /* The following are C++ inheritance testing. */ | |
206 | #ifdef __cplusplus | |
207 | ||
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; | |
216 | ||
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; | |
225 | ||
226 | #endif /* __cplusplus */ | |
227 | ||
228 | int | |
229 | main () | |
230 | { | |
231 | return 0; | |
232 | } |