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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [gdb/] [testsuite/] [gdb.cp/] [ovldbreak.cc] - Blame information for rev 157

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
  void foofunc (int);
10
  void foofunc (int, signed char *);
11
  int ifoo;
12
  const char *ccpfoo;
13
 
14
int overload1arg (void);
15
int overload1arg (char);
16
int overload1arg (signed char);
17
int overload1arg (unsigned char);
18
int overload1arg (short);
19
int overload1arg (unsigned short);
20
int overload1arg (int);
21
int overload1arg (unsigned int);
22
int overload1arg (long);
23
int overload1arg (unsigned long);
24
int overload1arg (float);
25
int overload1arg (double);
26
 
27
int overloadargs (int a1);
28
int overloadargs (int a1, int a2);
29
int overloadargs (int a1, int a2, int a3);
30
int overloadargs (int a1, int a2, int a3, int a4);
31
int overloadargs (int a1, int a2, int a3, int a4, int a5);
32
int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6);
33
int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7);
34
int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8);
35
int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9);
36
int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
37
                   int a8, int a9, int a10);
38
int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
39
                   int a8, int a9, int a10, int a11);
40
 
41
 
42
};
43
 
44
void marker1()
45
{}
46
 
47
int main ()
48
{
49
    char arg2 = 2;
50
    signed char arg3 =3;
51
    unsigned char arg4 =4;
52
    short arg5 =5;
53
    unsigned short arg6 =6;
54
    int arg7 =7;
55
    unsigned int arg8 =8;
56
    long arg9 =9;
57
    unsigned long arg10 =10;
58
    float arg11 =100.0;
59
    double arg12 = 200.0;
60
 
61
    char ch='A';
62
    foo foo_instance1(111);
63
    foo foo_instance2(222, &ch);
64
    foo foo_instance3(foo_instance2);
65
 
66
    foo_instance1.overload1arg();
67
    foo_instance1.overload1arg(arg2);
68
    foo_instance1.overload1arg(arg3);
69
    foo_instance1.overload1arg(arg4);
70
    foo_instance1.overload1arg(arg5);
71
    foo_instance1.overload1arg(arg6);
72
    foo_instance1.overload1arg(arg7);
73
    foo_instance1.overload1arg(arg8);
74
    foo_instance1.overload1arg(arg9);
75
    foo_instance1.overload1arg(arg10);
76
    foo_instance1.overload1arg(arg11);
77
    foo_instance1.overload1arg(arg12);
78
 
79
    foo_instance1.overloadargs(1);
80
    foo_instance1.overloadargs(1, 2);
81
    foo_instance1.overloadargs(1, 2, 3);
82
    foo_instance1.overloadargs(1, 2, 3, 4);
83
    foo_instance1.overloadargs(1, 2, 3, 4, 5);
84
    foo_instance1.overloadargs(1, 2, 3, 4, 5, 6);
85
    foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7);
86
    foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8);
87
    foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9);
88
    foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
89
    foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
90
 
91
 
92
    #ifdef usestubs
93
       set_debug_traps();
94
       breakpoint();
95
    #endif
96
 
97
 
98
    marker1();
99
    return 0;
100
}
101
 
102
foo::foo  (int i)                  { ifoo = i;}
103
foo::foo  (int i, const char *ccp) { ifoo = i; ccpfoo = ccp; }
104
foo::foo  (foo& afoo)              { ifoo = afoo.ifoo; ccpfoo = afoo.ccpfoo;}
105
foo::~foo ()                       {}
106
 
107
 
108
/* Some functions to test overloading by varying one argument type. */
109
 
110
int foo::overload1arg (void)                {  return 1; }
111
int foo::overload1arg (char arg)            { arg = 0; return 2;}
112
int foo::overload1arg (signed char arg)     { arg = 0; return 3;}
113
int foo::overload1arg (unsigned char arg)   { arg = 0; return 4;}
114
int foo::overload1arg (short arg)           { arg = 0; return 5;}
115
int foo::overload1arg (unsigned short arg)  { arg = 0; return 6;}
116
int foo::overload1arg (int arg)             { arg = 0; return 7;}
117
int foo::overload1arg (unsigned int arg)    { arg = 0; return 8;}
118
int foo::overload1arg (long arg)            { arg = 0; return 9;}
119
int foo::overload1arg (unsigned long arg)   { arg = 0; return 10;}
120
int foo::overload1arg (float arg)           { arg = 0; return 11;}
121
int foo::overload1arg (double arg)          { arg = 0; return 12;}
122
 
123
 
124
/* Some functions to test overloading by varying argument count. */
125
 
126
int foo::overloadargs (int a1)
127
{ a1 = 0;
128
return 1;}
129
 
130
int foo::overloadargs (int a1, int a2)
131
{ a1 = a2 = 0;
132
return 2;}
133
 
134
int foo::overloadargs (int a1, int a2, int a3)
135
{ a1 = a2 = a3 = 0;
136
return 3;}
137
 
138
int foo::overloadargs (int a1, int a2, int a3, int a4)
139
{ a1 = a2 = a3 = a4 = 0;
140
return 4;}
141
 
142
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5)
143
{ a1 = a2 = a3 = a4 = a5 = 0;
144
return 5;}
145
 
146
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6)
147
{ a1 = a2 = a3 = a4 = a5 = a6 = 0;
148
return 6;}
149
 
150
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7)
151
{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = 0;
152
return 7;}
153
 
154
int foo::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
return 8;}
158
 
159
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
160
                   int a8, int a9)
161
{
162
  a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0;
163
  return 9;
164
}
165
 
166
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
167
                   int a8, int a9, int a10)
168
                        { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
169
                          a10 = 0; return 10;}
170
 
171
int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7,
172
                   int a8, int a9, int a10, int a11)
173
                        { a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 =
174
                          a10 = a11 = 0; return 11;}
175
 
176
 
177
 

powered by: WebSVN 2.1.0

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