aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/nsusing.cc
blob: 72ff9414b1f9bcc848d770c055bed9a86b454e10 (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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
namespace M
{
  int x = 911;
}

namespace N
{
  int x = 912;
}

int marker10 ()
{
  using namespace M;
  int y = x + 1; // marker10 stop
  using namespace N;
  return y;
}

namespace J
{
  int jx = 44;
}

namespace K
{
  int marker9 ()
  {
    //x;
    return marker10 ();
  }
}

namespace L
{
  using namespace J;
  int marker8 ()
  {
    jx;
    return K::marker9 ();
  }
}

namespace G
{
  namespace H
  {
    int ghx = 6;
  }
}

namespace I
{
  int marker7 ()
  {
    using namespace G::H;
    ghx;
    return L::marker8 ();
  }
}

namespace E
{
  namespace F
  {
    int efx = 5;
  }
}

using namespace E::F;
int marker6 ()
{
  efx;
  return I::marker7 ();
}

namespace A
{
  int _a = 1;
  int x = 2;
}

namespace C
{
  int cc = 3;
}

namespace D
{
  int dx = 4;
}

using namespace C;
int marker5 ()
{
  cc;
  return marker6 ();
}

int marker4 ()
{
  using D::dx;
  return marker5 ();
}

int marker3 ()
{
  return marker4 ();
}

int marker2 ()
{
  namespace B = A;
  B::_a;
  return marker3 ();
}

int marker1 ()
{
  int total = 0;
    {
      int b = 1;
        {
          using namespace A;
          int c = 2;
            {
              int d = 3;
              total = _a + b + c + d + marker2 (); // marker1 stop
            }
        }
    }
  return marker2 () + total;
}

int main ()
{
  using namespace A;
  _a;
  return marker1 ();
}