summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/debug/dwarf2/pr44641.C
blob: 2df002f6b007c05ee88952dfd8cd09ce5087549f (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
// Origin: PR 44641
// { dg-do compile }
// { dg-options "-g -O0 -dA" }

template <class A> struct MisplacedDbg;
template<class T> struct MisplacedDbg<T*>;
struct Full;
template<> struct MisplacedDbg<Full>;

struct Arg;
typedef MisplacedDbg<Arg> Typedef1;
typedef MisplacedDbg<Arg*> Typedef2;
typedef MisplacedDbg<Full> Typedef3;

template<typename T> struct Base  {
  virtual ~Base() {
  }
};

template <>
struct MisplacedDbg<Full>  // { dg-function-on-line {_ZN12MisplacedDbgI4FullEC[12]Ev} }
                           // { dg-function-on-line {_ZN12MisplacedDbgI4FullED0Ev} { target *-*-* } 21 }

    : public Base<int> {
};

template <class T>
struct MisplacedDbg<T*>  // { dg-function-on-line {_ZN12MisplacedDbgIP3ArgEC[12]Ev} }
                         // { dg-function-on-line {_ZN12MisplacedDbgIP3ArgED0Ev} { target *-*-* } 28 }
    : public Base<int> {
};

template <class A>
struct MisplacedDbg  // { dg-function-on-line {_ZN12MisplacedDbgI3ArgEC[12]Ev} }
                     // { dg-function-on-line {_ZN12MisplacedDbgI3ArgED0Ev} { target *-*-* } 34 }
    : public Base<int> {
};

static MisplacedDbg<Arg> static_var1;
static MisplacedDbg<Arg*> static_var2;
static MisplacedDbg<Full> static_var3;