summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.hp/namespace.cc
blob: 53d5bd6608dda02ddf10341e7ef1543e778e2d21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
namespace AAA {
  char c;
  int i;
  int A_foo (int);
  char foo (char);
  class inA {
  public:
    int xx;
    int fum (int);
  };
};

int AAA::inA::fum (int i)
{
  return 10 + i;
}

namespace BBB {
  char c;
  int i;
  int B_foo (int);
  char foo (char);

  namespace CCC {
    char foo (char);
  };

  class Class {
  public:
    char foo (char);
    int dummy;
  };
};

int AAA::A_foo (int x)
{
  return 2 * x;
}

char AAA::foo (char c)
{
  return 'a';
}


int BBB::B_foo (int x)
{
  return 3 * x;
}

char BBB::foo (char c)
{
  return 'b';
}

char BBB::CCC::foo (char c)
{
  return 'z';
}

char BBB::Class::foo (char c)
{
  return 'o';
}

void marker1(void)
{
  return;
}


int main ()
{
  using AAA::inA;
  char c1;

  using namespace BBB;
  
  c1 = foo ('x');
  c1 = AAA::foo ('x');
  c1 = BBB::CCC::foo ('m');
  
  inA ina;

  ina.xx = 33;

  int y;

  y = AAA::A_foo (33);
  y += B_foo (44);

  BBB::Class cl;

  c1 = cl.foo('e');

  marker1();
  
}