No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gdb6 / gdb / testsuite / gdb.cp / namespace.cc
blobee55168528b06b061d6064b97b92f110d3ef2a10
1 namespace AAA {
2 char c;
3 int i;
4 int A_xyzq (int);
5 char xyzq (char);
6 class inA {
7 public:
8 int xx;
9 int fum (int);
13 int AAA::inA::fum (int i)
15 return 10 + i;
18 namespace BBB {
19 char c;
20 int i;
21 int B_xyzq (int);
22 char xyzq (char);
24 namespace CCC {
25 char xyzq (char);
28 class Class {
29 public:
30 char xyzq (char);
31 int dummy;
35 int AAA::A_xyzq (int x)
37 return 2 * x;
40 char AAA::xyzq (char c)
42 return 'a';
46 int BBB::B_xyzq (int x)
48 return 3 * x;
51 char BBB::xyzq (char c)
53 return 'b';
56 char BBB::CCC::xyzq (char c)
58 return 'z';
61 char BBB::Class::xyzq (char c)
63 return 'o';
66 void marker1(void)
68 return;
71 namespace
73 int X = 9;
75 namespace G
77 int Xg = 10;
79 namespace
81 int XgX = 11;
86 namespace C
88 int c = 1;
89 int shadow = 12;
91 class CClass {
92 public:
93 int x;
94 class NestedClass {
95 public:
96 int y;
100 void ensureRefs () {
101 // NOTE (2004-04-23, carlton): This function is here only to make
102 // sure that GCC 3.4 outputs debug info for these classes.
103 static CClass *c = new CClass();
104 static CClass::NestedClass *n = new CClass::NestedClass();
107 namespace
109 int cX = 6;
111 namespace F
113 int cXf = 7;
115 namespace
117 int cXfX = 8;
122 namespace C
124 int cc = 2;
127 namespace E
129 int ce = 4;
132 namespace D
134 int cd = 3;
135 int shadow = 13;
137 namespace E
139 int cde = 5;
142 void marker2 (void)
144 // NOTE: carlton/2003-04-23: I'm listing the expressions that I
145 // plan to have GDB try to print out, just to make sure that the
146 // compiler and I agree which ones should be legal! It's easy
147 // to screw up when testing the boundaries of namespace stuff.
149 //cc;
150 C::cc;
152 //C::D::cd;
153 E::cde;
154 shadow;
155 //E::ce;
157 F::cXf;
158 F::cXfX;
160 G::Xg;
161 //cXOtherFile;
162 //XOtherFile;
163 G::XgX;
165 return;
171 int main ()
173 using AAA::inA;
174 char c1;
176 using namespace BBB;
178 c1 = xyzq ('x');
179 c1 = AAA::xyzq ('x');
180 c1 = BBB::CCC::xyzq ('m');
182 inA ina;
184 ina.xx = 33;
186 int y;
188 y = AAA::A_xyzq (33);
189 y += B_xyzq (44);
191 BBB::Class cl;
193 c1 = cl.xyzq('e');
195 marker1();
197 C::D::marker2 ();