1 /* This testcase is part of GDB, the GNU debugger.
3 Copyright 2014-2020 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/>. */
22 #define ARG_MACRO(X, Y) ((X) + (Y) - 1)
30 typedef int v4 __attribute__ ((vector_size (16)));
36 unsigned char ucharfield;
38 unsigned short ushortfield;
40 unsigned int uintfield;
41 unsigned int bitfield : 3;
43 unsigned long ulongfield;
44 enum enum_type enumfield;
47 const union union_type *ptrfield;
48 struct struct_type *selffield;
50 _Complex double complexfield;
55 typedef int inttypedef;
59 inttypedef typedeffield;
62 /* volatile provides some coverage of the conversion code. */
63 volatile struct struct_type struct_object;
65 union union_type union_object;
68 enum ulonger_enum_type {
69 REALLY_MINUS_1 = -1UL,
72 enum ulonger_enum_type ulonger;
74 enum longer_enum_type {
76 FORCE_TO_LONG = 1L << ((8 * sizeof (long)) - 2)
79 enum longer_enum_type longer;
84 func_static (int addend)
90 func_global (int subtrahend)
92 globalvar -= subtrahend;
98 /* no_args_or_locals breakpoint */
102 int globalshadow = 10;
103 static int staticshadow = 20;
108 virtual int pure_virt () = 0;
110 int return_value () {return a;}
118 virtual int non_pure () {return 84;}
120 int return_value () {return b;}
129 int return_value () {return b;}
135 class Multiple : public Base, public Base2
139 int a = Base::return_value ();
143 //struct foo { foo(); virtual ~foo(); }; struct bar : virtual foo { bar(); ~bar(); }; struct baz : bar {}; bar::bar() {} bar::~bar() {} bar t; baz u;
147 virtual ~VirtualOnly()=0;
150 VirtualOnly::VirtualOnly ()
154 VirtualOnly::~VirtualOnly ()
158 struct VirtualBase : virtual VirtualOnly
165 struct VirtualBase2 : VirtualBase {};
167 VirtualBase::VirtualBase ()
172 VirtualBase::~VirtualBase ()
180 static const int public_static_var = 12;
184 int private_method ();
188 int public_method ();
189 void set_private_var (int);
192 void Foo::set_private_var (int i)
197 int Foo::private_method ()
202 int Foo::public_method ()
214 int globalshadow = 100;
215 int staticshadow = 200;
220 Multiple *multivar = new Multiple;
223 static int static_local = 77000;
225 foovar.public_var = 42;
226 foovar.set_private_var (42);
227 multivar->Base2::return_value();
229 int another_local = 7;
231 extern int unresolved;
236 func_static (0); /* break-here */
237 no_args_or_locals ();