OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.2/] [gdb/] [testsuite/] [gdb.cp/] [koenig.cc] - Blame information for rev 330

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 330 jeremybenn
namespace A
2
{
3
  class C
4
  {
5
  public:
6
    static const int x = 11;
7
  };
8
 
9
  int
10
  first (C c)
11
  {
12
    return 11;
13
  }
14
 
15
  int
16
  first (int a, C c)
17
  {
18
    return 22;
19
  }
20
 
21
  int
22
  second (int a, int b, C cc, int c, int d)
23
  {
24
    return 33;
25
  }
26
 
27
}
28
 
29
struct B
30
{
31
  A::C c;
32
};
33
 
34
//------------
35
 
36
namespace E
37
{
38
  class O{};
39
  int foo (O o){return 1; }
40
  int foo (O o, O o2){return 2; }
41
  int foo (O o, O o2, int i){return 3; }
42
}
43
 
44
namespace F
45
{
46
  class O{};
47
  int foo (       O fo, ::E::O eo){ return 4;}
48
  int foo (int i, O fo, ::E::O eo){ return 5;}
49
}
50
 
51
namespace G
52
{
53
  class O{};
54
  int foo (O go, ::F::O fo, ::E::O eo){ return 6; }
55
}
56
 
57
//------------
58
 
59
namespace H
60
{
61
  class O{};
62
  int foo (O){ return 7;}
63
}
64
 
65
namespace I
66
{
67
  class O: public H::O {};
68
  class X: H::O{};
69
}
70
 
71
//------------
72
 
73
namespace J
74
{
75
  union U{};
76
  struct S{};
77
  enum E{};
78
 
79
  class A{
80
  public:
81
    class B{};
82
  };
83
 
84
  class C{};
85
 
86
  int foo (U){ return 8;}
87
  int foo (S){ return 9;}
88
  int foo (E){ return 10;}
89
  int foo (A::B){ return 11;}
90
  int foo (A*){ return 12;}
91
  int foo (A**){ return 13;}
92
  int foo (C[]){ return 14;}
93
 
94
}
95
//------------
96
 
97
namespace K{
98
  class O{};
99
 
100
  int foo(O, int){
101
    return 15;
102
  }
103
 
104
  int bar(O, int){
105
    return 15;
106
  }
107
}
108
 
109
int foo(K::O, float){
110
  return 16;
111
}
112
 
113
int bar(K::O, int){
114
  return 16;
115
}
116
//------------
117
 
118
namespace L {
119
  namespace A{
120
    namespace B{
121
    class O {};
122
 
123
    int foo (O){
124
      return 17;
125
    }
126
 
127
    }
128
  }
129
}
130
 
131
//------------
132
 
133
namespace M {
134
  class A{
135
  public:
136
    int foo(char) {
137
      return 18;
138
    }
139
  };
140
 
141
  int foo(A,char){
142
      return 19;
143
  }
144
 
145
  int foo(A *,char){
146
    return 23;
147
  }
148
 
149
  int bar(char){
150
    return 21;
151
  }
152
 
153
  namespace N {
154
    int foo(::M::A,int){
155
      return 20;
156
    }
157
 
158
    int bar(int){
159
      return 22;
160
    }
161
  }
162
}
163
//------------
164
 
165
namespace O {
166
  class A{};
167
 
168
  int foo(A,int){
169
    return 23;
170
  }
171
 
172
}
173
 
174
typedef O::A TOA;
175
typedef TOA  TTOA;
176
 
177
//------------
178
 
179
static union {
180
    int  a;
181
    char b;
182
}p_union;
183
 
184
//------------
185
 
186
namespace P {
187
  class Q{
188
  public:
189
    int operator== (int)
190
      {
191
        return 24;
192
      }
193
 
194
    int operator== (float)
195
      {
196
        return 25;
197
      }
198
 
199
    int operator+ (float)
200
      {
201
        return 26;
202
      }
203
 
204
  };
205
 
206
  int operator!= (Q, int)
207
    {
208
      return 27;
209
    }
210
 
211
  int operator!= (Q, double)
212
    {
213
      return 28;
214
    }
215
 
216
  int operator+ (Q, int)
217
    {
218
      return 29;
219
    }
220
 
221
  int operator++ (Q)
222
    {
223
      return 30;
224
    }
225
}
226
 
227
//------------
228
 
229
int
230
main ()
231
{
232
  A::C c;
233
  B b;
234
 
235
  A::first (c);
236
  first (0, c);
237
  second (0, 0, c, 0, 0);
238
  A::first (b.c);
239
 
240
  E::O eo;
241
  F::O fo;
242
  G::O go;
243
 
244
  foo (eo);
245
  foo (eo, eo);
246
  foo (eo, eo, 1);
247
  foo (fo, eo);
248
  foo (1  ,fo, eo);
249
  foo (go, fo, eo);
250
 
251
  I::O io;
252
  I::X ix;
253
 
254
  foo (io);
255
//foo (ix);
256
 
257
  J::U ju;
258
  J::S js;
259
  J::E je;
260
  J::A::B jab;
261
  J::A *jap;
262
  J::A **japp;
263
  J::C jca[3];
264
 
265
  foo (ju);
266
  foo (js);
267
  foo (je);
268
  foo (jab);
269
  foo (jap);
270
  foo (japp);
271
  foo (jca);
272
 
273
  K::O ko;
274
  foo (ko, 1);
275
  foo (ko, 1.0f);
276
  //bar(ko,1);
277
 
278
  L::A::B::O labo;
279
  foo (labo);
280
 
281
  M::A ma;
282
  foo(ma,'a');
283
  ma.foo('a');
284
  M::N::foo(ma,'a');
285
 
286
  M::bar('a');
287
  M::N::bar('a');
288
 
289
  TTOA ttoa;
290
  foo (ttoa, 'a');
291
 
292
  P::Q q;
293
  q == 5;
294
  q == 5.0f;
295
  q != 5;
296
  q != 5.0f;
297
  q + 5;
298
  q + 5.0f;
299
 
300
  ++q;
301
 
302
  return first (0, c) + foo (eo) +
303
         foo (eo, eo) + foo (eo, eo, 1)  +
304
         foo (fo, eo) + foo (1  ,fo, eo) +
305
         foo (go, fo, eo);
306
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.