2004-02-07 Elena Zannoni <ezannoni@redhat.com>
[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
121
122
123
124int A::afoo() {
125 return 1;
126}
127
128int B::bfoo() {
129 return 2;
130}
131
132int C::cfoo() {
133 return 3;
134}
135
136int D::dfoo() {
137 return 4;
138}
139
140int E::efoo() {
141 return 5;
142}
143
144int F::ffoo() {
145 return 6;
146}
147
148int G::gfoo() {
149 return 77;
150}
151
152int A::foo()
153{
154 return 7;
155
156}
157
158int B::foo()
159{
160 return 8;
161
162}
163
164int C::foo()
165{
166 return 9;
167
168}
169
170int D::foo()
171{
172 return 10;
173
174}
175
176int E::foo()
177{
178 return 11;
179
180}
181
182int F::foo()
183{
184 return 12;
185
186}
187
188int G::foo()
189{
190 return 13;
191
192}
193
194
195void marker1()
196{
197}
198
199
200int main(void)
201{
202
203 A a_instance;
204 B b_instance;
205 C c_instance;
206 D d_instance;
207 E e_instance;
208 F f_instance;
209 G g_instance;
210
211 #ifdef usestubs
212 set_debug_traps();
213 breakpoint();
214 #endif
215
216
93201743 217 marker1(); // marker1-returns-here
c906108c 218
93201743 219 a_instance.a = 20; // marker1-returns-here
c906108c
SS
220 a_instance.aa = 21;
221 b_instance.b = 22;
222 b_instance.bb = 23;
223 c_instance.c = 24;
224 c_instance.cc = 25;
225 d_instance.d = 26;
226 d_instance.dd = 27;
227 e_instance.e = 28;
228 e_instance.ee =29;
229 f_instance.f =30;
230 f_instance.ff =31;
231
232
233
234
235 return 0;
236
237}
238
239
240
This page took 0.429073 seconds and 4 git commands to generate.