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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [gdb/] [testsuite/] [gdb.cp/] [cplusfuncs.cc] - Blame information for rev 862

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 227 jeremybenn
#include <stddef.h>
2
 
3
class foo {
4
public:
5
  foo  (int);
6
  foo  (int, const char *);
7
  foo  (foo&);
8
  ~foo ();
9
 
10
  void  operator *      (foo&);
11
  void  operator %      (foo&);
12
  void  operator -      (foo&);
13
  void  operator >>     (foo&);
14
  void  operator !=     (foo&);
15
  void  operator >      (foo&);
16
  void  operator >=     (foo&);
17
  void  operator |      (foo&);
18
  void  operator &&     (foo&);
19
  void  operator !      (void);
20
  void  operator ++     (int);
21
  void  operator =      (foo&);
22
  void  operator +=     (foo&);
23
  void  operator *=     (foo&);
24
  void  operator %=     (foo&);
25
  void  operator >>=    (foo&);
26
  void  operator |=     (foo&);
27
  void  operator ,      (foo&);
28
  void  operator /      (foo&);
29
  void  operator +      (foo&);
30
  void  operator <<     (foo&);
31
  void  operator ==     (foo&);
32
  void  operator <      (foo&);
33
  void  operator <=     (foo&);
34
  void  operator &      (foo&);
35
  void  operator ^      (foo&);
36
  void  operator ||     (foo&);
37
  void  operator ~      (void);
38
  void  operator --     (int);
39
  foo*  operator ->     (void);
40
  void  operator -=     (foo&);
41
  void  operator /=     (foo&);
42
  void  operator <<=    (foo&);
43
  void  operator &=     (foo&);
44
  void  operator ^=     (foo&);
45
  void  operator ->*    (foo&);
46
  void  operator []     (foo&);
47
  void  operator ()     (foo&);
48
  void* operator new    (size_t) throw ();
49
  void* operator new[]  (size_t) throw ();
50
  void  operator delete (void *);
51
  void  operator delete[] (void *);
52
  /**/  operator int    ();
53
  /**/  operator char*  ();
54
 
55
  int foofunc (int); // forced to have int return type, which is required
56
  int foofunc (int, signed char *); // forced to have int return type, which is required
57
  int ifoo;
58
  const char *ccpfoo;
59
};
60
 
61
#ifdef usestubs
62
extern "C" {
63
   void set_debug_traps();
64
   void breakpoint();
65
};
66
#endif
67
 
68
int main () {
69
#ifdef usestubs
70
   set_debug_traps();
71
   breakpoint();
72
#endif
73
   int z=3;
74
}
75
 
76
foo::foo  (int i)                  { ifoo = i;}
77
foo::foo  (int i, const char *ccp) { ifoo = i; ccpfoo = ccp; }
78
foo::foo  (foo& afoo)              { afoo.ifoo = 0; }
79
foo::~foo ()                       {}
80
 
81
void  foo::operator *      (foo& afoo) { afoo.ifoo = 0; }
82
void  foo::operator %      (foo& afoo) { afoo.ifoo = 0; }
83
void  foo::operator -      (foo& afoo) { afoo.ifoo = 0; }
84
void  foo::operator >>     (foo& afoo) { afoo.ifoo = 0; }
85
void  foo::operator !=     (foo& afoo) { afoo.ifoo = 0; }
86
void  foo::operator >      (foo& afoo) { afoo.ifoo = 0; }
87
void  foo::operator >=     (foo& afoo) { afoo.ifoo = 0; }
88
void  foo::operator |      (foo& afoo) { afoo.ifoo = 0; }
89
void  foo::operator &&     (foo& afoo) { afoo.ifoo = 0; }
90
void  foo::operator !      (void) {}
91
void  foo::operator ++     (int ival) { ival = 0; }
92
void  foo::operator =      (foo& afoo) { afoo.ifoo = 0; }
93
void  foo::operator +=     (foo& afoo) { afoo.ifoo = 0; }
94
void  foo::operator *=     (foo& afoo) { afoo.ifoo = 0; }
95
void  foo::operator %=     (foo& afoo) { afoo.ifoo = 0; }
96
void  foo::operator >>=    (foo& afoo) { afoo.ifoo = 0; }
97
void  foo::operator |=     (foo& afoo) { afoo.ifoo = 0; }
98
void  foo::operator ,      (foo& afoo) { afoo.ifoo = 0; }
99
void  foo::operator /      (foo& afoo) { afoo.ifoo = 0; }
100
void  foo::operator +      (foo& afoo) { afoo.ifoo = 0; }
101
void  foo::operator <<     (foo& afoo) { afoo.ifoo = 0; }
102
void  foo::operator ==     (foo& afoo) { afoo.ifoo = 0; }
103
void  foo::operator <      (foo& afoo) { afoo.ifoo = 0; }
104
void  foo::operator <=     (foo& afoo) { afoo.ifoo = 0; }
105
void  foo::operator &      (foo& afoo) { afoo.ifoo = 0; }
106
void  foo::operator ^      (foo& afoo) { afoo.ifoo = 0; }
107
void  foo::operator ||     (foo& afoo) { afoo.ifoo = 0; }
108
void  foo::operator ~      (void) {}
109
void  foo::operator --     (int ival) { ival = 0; }
110
foo*  foo::operator ->     (void) {return this;}
111
void  foo::operator -=     (foo& afoo) { afoo.ifoo = 0; }
112
void  foo::operator /=     (foo& afoo) { afoo.ifoo = 0; }
113
void  foo::operator <<=    (foo& afoo) { afoo.ifoo = 0; }
114
void  foo::operator &=     (foo& afoo) { afoo.ifoo = 0; }
115
void  foo::operator ^=     (foo& afoo) { afoo.ifoo = 0; }
116
void  foo::operator ->*    (foo& afoo) { afoo.ifoo = 0; }
117
void  foo::operator []     (foo& afoo) { afoo.ifoo = 0; }
118
void  foo::operator ()     (foo& afoo) { afoo.ifoo = 0; }
119
void* foo::operator new    (size_t ival) throw () { ival = 0; return 0; }
120
void* foo::operator new[]    (size_t ival) throw () { ival = 0; return 0; }
121
void  foo::operator delete (void *ptr) { ptr = 0; }
122
void  foo::operator delete[] (void *ptr) { ptr = 0; }
123
/**/  foo::operator int    () { return 0; }
124
/**/  foo::operator char*  () { return 0; }
125
 
126
/* Some functions to test overloading by varying one argument type. */
127
 
128
void overload1arg (void)                {          }
129
void overload1arg (char arg)            { arg = 0; }
130
void overload1arg (signed char arg)     { arg = 0; }
131
void overload1arg (unsigned char arg)   { arg = 0; }
132
void overload1arg (short arg)           { arg = 0; }
133
void overload1arg (unsigned short arg)  { arg = 0; }
134
void overload1arg (int arg)             { arg = 0; }
135
void overload1arg (unsigned int arg)    { arg = 0; }
136
void overload1arg (long arg)            { arg = 0; }
137
void overload1arg (unsigned long arg)   { arg = 0; }
138
void overload1arg (float arg)           { arg = 0; }
139
void overload1arg (double arg)          { arg = 0; }
140
 
141
/* Some functions to test overloading by varying argument count. */
142
 
143
void overloadargs (int a1)                              { a1 = 0; }
144
void overloadargs (int a1, int a2)                      { a1 = a2 = 0; }
145
void overloadargs (int a1, int a2, int a3)              { a1 = a2 = a3 = 0; }
146
void overloadargs (int a1, int a2, int a3, int a4)
147
                        { a1 = a2 = a3 = a4 = 0; }
148
void overloadargs (int a1, int a2, int a3, int a4, int a5)
149
                        { a1 = a2 = a3 = a4 = a5 = 0; }
150
void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6)
151
                        { a1 = a2 = a3 = a4 = a5 = a6 = 0; }
152
void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7)
153
                        { a1 = a2 = a3 = a4 = a5 = a6 = a7 = 0; }
154
void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
155
                   int a8)
156
                        { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 0; }
157
void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
158
                   int a8, int a9)
159
                        { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0; }
160
void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
161
                   int a8, int a9, int a10)
162
                        { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
163
                          a10 = 0; }
164
void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
165
                   int a8, int a9, int a10, int a11)
166
                        { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
167
                          a10 = a11 == 0; }
168
 
169
/* Some hairy function definitions.
170
   Use typedefs to help maintain sanity. */
171
 
172
typedef int   (*PFPc_i)(char *);
173
typedef short (*PFPl_s)(long *);
174
typedef short (*PFPc_s)(char *);
175
typedef int   (*PFl_i)(long);
176
typedef PFl_i (*PFPc_PFl_i)(char *);
177
typedef PFl_i (*PFPi_PFl_i)(int *);
178
typedef PFl_i (*PFPFPc_i_PFl_i)(PFPc_i);
179
typedef PFl_i (*PFs_PFl_i)(short);
180
typedef int   (*PFPFPl_s_i)(PFPl_s);
181
typedef int   (*PFPFPc_s_i)(PFPc_s);
182
 
183
PFs_PFl_i hairyfunc1 (int arg)                  { arg = 0; return 0; }
184
int       hairyfunc2 (PFPc_i arg)               { arg = 0; return 0; }
185
int       hairyfunc3 (PFPFPl_s_i arg)           { arg = 0; return 0; }
186
int       hairyfunc4 (PFPFPc_s_i arg)           { arg = 0; return 0; }
187
int       hairyfunc5 (PFPc_PFl_i arg)           { arg = 0; return 0; }
188
int       hairyfunc6 (PFPi_PFl_i arg)           { arg = 0; return 0; }
189
int       hairyfunc7 (PFPFPc_i_PFl_i arg)       { arg = 0; return 0; }
190
 
191
/* gdb has two demanglers (one for g++ 2.95, one for g++ 3).
192
   These marker functions help me figure out which demangler is in use. */
193
 
194
char *  dm_type_char_star (char * p)            { return p; }
195
int     dm_type_foo_ref (foo & foo)             { return foo.ifoo; }
196
int *   dm_type_int_star (int * p)              { return p; }
197
long *  dm_type_long_star (long * p)            { return p; }
198
int     dm_type_unsigned_int (unsigned int i)   { return i; }
199
int     dm_type_void (void)                     { return 0; }
200
void *  dm_type_void_star (void * p)            { return p; }

powered by: WebSVN 2.1.0

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