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/>. */
205 /* The following are C++ inheritance testing. */
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. */
236 /* In targets like AIX, linker optimises out unused global
237 variables. The do_nothing () function stops the linker