summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/debug/dwarf2/nested-1.C
blob: 336582c112acfd950ab8bc9a005620bf2de5a841 (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
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin PR debug/40109
// { dg-do compile }
// { dg-options  "-g -dA -O0" }

namespace A
{

  class B
  {
  };
  typedef A::B AB;
};

int
main()
{
  A::AB ab;
  return 0;
}

// { dg-final { scan-assembler "DW_TAG_typedef" } }
//
// What we want to do here is to be sure that the DIE of A::AB is generated
// as a child of the DIE of the namespace A declaration.
// So this test won't catch a regression on this fix yet. To write a proper
// test for this fix, we would need a dwarf reader written in tcl,
// or something along those lines.