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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 24 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 delete (void *);
50
  /**/  operator int    ();
51
  /**/  operator char*  ();
52
 
53
  int foofunc (int); // forced to have int return type, which is required
54
  int foofunc (int, signed char *); // forced to have int return type, which is required
55
  int ifoo;
56
  const char *ccpfoo;
57
};
58
 
59
#ifdef usestubs
60
extern "C" {
61
   void set_debug_traps();
62
   void breakpoint();
63
};
64
#endif
65
 
66
int main () {
67
#ifdef usestubs
68
   set_debug_traps();
69
   breakpoint();
70
#endif
71
   int z=3;
72
}
73
 
74
foo::foo  (int i)                  { ifoo = i;}
75
foo::foo  (int i, const char *ccp) { ifoo = i; ccpfoo = ccp; }
76
foo::foo  (foo& afoo)              { afoo.ifoo = 0; }
77
foo::~foo ()                       {}
78
 
79
void  foo::operator *      (foo& afoo) { afoo.ifoo = 0; }
80
void  foo::operator %      (foo& afoo) { afoo.ifoo = 0; }
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 !      (void) {}
89
void  foo::operator ++     (int ival) { ival = 0; }
90
void  foo::operator =      (foo& afoo) { afoo.ifoo = 0; }
91
void  foo::operator +=     (foo& afoo) { afoo.ifoo = 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 ~      (void) {}
107
void  foo::operator --     (int ival) { ival = 0; }
108
foo*  foo::operator ->     (void) {return this;}
109
void  foo::operator -=     (foo& afoo) { afoo.ifoo = 0; }
110
void  foo::operator /=     (foo& afoo) { afoo.ifoo = 0; }
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 new    (size_t ival) throw () { ival = 0; return 0; }
118
void  foo::operator delete (void *ptr) { ptr = 0; }
119
/**/  foo::operator int    () { return 0; }
120
/**/  foo::operator char*  () { return 0; }
121
 
122
/* Some functions to test overloading by varying one argument type. */
123
 
124
void overload1arg (void)                {          }
125
void overload1arg (char arg)            { arg = 0; }
126
void overload1arg (signed char arg)     { arg = 0; }
127
void overload1arg (unsigned char arg)   { arg = 0; }
128
void overload1arg (short arg)           { arg = 0; }
129
void overload1arg (unsigned short arg)  { arg = 0; }
130
void overload1arg (int arg)             { arg = 0; }
131
void overload1arg (unsigned int arg)    { arg = 0; }
132
void overload1arg (long arg)            { arg = 0; }
133
void overload1arg (unsigned long arg)   { arg = 0; }
134
void overload1arg (float arg)           { arg = 0; }
135
void overload1arg (double arg)          { arg = 0; }
136
 
137
/* Some functions to test overloading by varying argument count. */
138
 
139
void overloadargs (int a1)                              { a1 = 0; }
140
void overloadargs (int a1, int a2)                      { a1 = a2 = 0; }
141
void overloadargs (int a1, int a2, int a3)              { a1 = a2 = a3 = 0; }
142
void overloadargs (int a1, int a2, int a3, int a4)
143
                        { a1 = a2 = a3 = a4 = 0; }
144
void overloadargs (int a1, int a2, int a3, int a4, int a5)
145
                        { a1 = a2 = a3 = a4 = a5 = 0; }
146
void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6)
147
                        { a1 = a2 = a3 = a4 = a5 = a6 = 0; }
148
void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7)
149
                        { a1 = a2 = a3 = a4 = a5 = a6 = a7 = 0; }
150
void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
151
                   int a8)
152
                        { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 0; }
153
void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
154
                   int a8, int a9)
155
                        { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0; }
156
void overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
157
                   int a8, int a9, int a10)
158
                        { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
159
                          a10 = 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, int a11)
162
                        { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
163
                          a10 = a11 == 0; }
164
 
165
/* Some hairy function definitions.
166
   Use typedefs to help maintain sanity. */
167
 
168
typedef int   (*PFPc_i)(char *);
169
typedef short (*PFPl_s)(long *);
170
typedef short (*PFPc_s)(char *);
171
typedef int   (*PFl_i)(long);
172
typedef PFl_i (*PFPc_PFl_i)(char *);
173
typedef PFl_i (*PFPi_PFl_i)(int *);
174
typedef PFl_i (*PFPFPc_i_PFl_i)(PFPc_i);
175
typedef PFl_i (*PFs_PFl_i)(short);
176
typedef int   (*PFPFPl_s_i)(PFPl_s);
177
typedef int   (*PFPFPc_s_i)(PFPc_s);
178
 
179
PFs_PFl_i hairyfunc1 (int arg)                  { arg = 0; return 0; }
180
int       hairyfunc2 (PFPc_i arg)               { arg = 0; return 0; }
181
int       hairyfunc3 (PFPFPl_s_i arg)           { arg = 0; return 0; }
182
int       hairyfunc4 (PFPFPc_s_i arg)           { arg = 0; return 0; }
183
int       hairyfunc5 (PFPc_PFl_i arg)           { arg = 0; return 0; }
184
int       hairyfunc6 (PFPi_PFl_i arg)           { arg = 0; return 0; }
185
int       hairyfunc7 (PFPFPc_i_PFl_i arg)       { arg = 0; return 0; }
186
 
187
/* gdb has two demanglers (one for g++ 2.95, one for g++ 3).
188
   These marker functions help me figure out which demangler is in use. */
189
 
190
char *  dm_type_char_star (char * p)            { return p; }
191
int     dm_type_foo_ref (foo & foo)             { return foo.ifoo; }
192
int *   dm_type_int_star (int * p)              { return p; }
193
long *  dm_type_long_star (long * p)            { return p; }
194
int     dm_type_unsigned_int (unsigned int i)   { return i; }
195
int     dm_type_void (void)                     { return 0; }
196
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.