* main.c (gdb_datadir_provided): New static global.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / derivation.cc
CommitLineData
c906108c
SS
1class A {
2public:
3 int a;
4 int aa;
5
6 A()
7 {
8 a=1;
9 aa=2;
10 }
11 int afoo();
12 int foo();
13
14};
15
16
17
18class B {
19public:
20 int b;
21 int bb;
22
23 B()
24 {
25 b=3;
26 bb=4;
27 }
28 int bfoo();
29 int foo();
30
31};
32
33
34
35class C {
36public:
37 int c;
38 int cc;
39
40 C()
41 {
42 c=5;
43 cc=6;
44 }
45 int cfoo();
46 int foo();
47
48};
49
50
51
52class D : private A, public B, protected C {
53public:
54 int d;
55 int dd;
56
57 D()
58 {
59 d =7;
60 dd=8;
61 }
62 int dfoo();
63 int foo();
64
65};
66
67
68class E : public A, B, protected C {
69public:
70 int e;
71 int ee;
72
73 E()
74 {
75 e =9;
76 ee=10;
77 }
78 int efoo();
79 int foo();
80
81};
82
83
84class F : A, public B, C {
85public:
86 int f;
87 int ff;
88
89 F()
90 {
91 f =11;
92 ff=12;
93 }
94 int ffoo();
95 int foo();
96
97};
98
99class G : private A, public B, protected C {
100public:
101 int g;
102 int gg;
103 int a;
104 int b;
105 int c;
106
107 G()
108 {
109 g =13;
110 gg =14;
111 a=15;
112 b=16;
113 c=17;
114
115 }
116 int gfoo();
117 int foo();
118
119};
120
7977e5d2
TT
121class V_base
122{
123public:
124 virtual void m();
125 int base;
126};
127
128void
129V_base::m()
130{
131}
c906108c 132
7977e5d2
TT
133class V_inter : public virtual V_base
134{
135public:
136 virtual void f();
137 int inter;
138};
139
140void
141V_inter::f()
142{
143}
144
145class V_derived : public V_inter
146{
147public:
148 double x;
149};
c906108c 150
7977e5d2 151V_derived vderived;
c906108c
SS
152
153int A::afoo() {
154 return 1;
155}
156
157int B::bfoo() {
158 return 2;
159}
160
161int C::cfoo() {
162 return 3;
163}
164
165int D::dfoo() {
166 return 4;
167}
168
169int E::efoo() {
170 return 5;
171}
172
173int F::ffoo() {
174 return 6;
175}
176
177int G::gfoo() {
178 return 77;
179}
180
181int A::foo()
182{
183 return 7;
184
185}
186
187int B::foo()
188{
189 return 8;
190
191}
192
193int C::foo()
194{
195 return 9;
196
197}
198
199int D::foo()
200{
201 return 10;
202
203}
204
205int E::foo()
206{
207 return 11;
208
209}
210
211int F::foo()
212{
213 return 12;
214
215}
216
217int G::foo()
218{
219 return 13;
220
221}
222
223
224void marker1()
225{
226}
227
228
229int main(void)
230{
231
232 A a_instance;
233 B b_instance;
234 C c_instance;
235 D d_instance;
236 E e_instance;
237 F f_instance;
238 G g_instance;
239
93201743 240 marker1(); // marker1-returns-here
c906108c 241
93201743 242 a_instance.a = 20; // marker1-returns-here
c906108c
SS
243 a_instance.aa = 21;
244 b_instance.b = 22;
245 b_instance.bb = 23;
246 c_instance.c = 24;
247 c_instance.cc = 25;
248 d_instance.d = 26;
249 d_instance.dd = 27;
250 e_instance.e = 28;
251 e_instance.ee =29;
252 f_instance.f =30;
253 f_instance.ff =31;
254
255
256
257
258 return 0;
259
260}
261
262
263
This page took 1.184791 seconds and 4 git commands to generate.