OSDN Git Service

Fix PR debug/49047
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / debug / dwarf2 / pr44641.C
1 // Origin: PR 44641
2 // { dg-do compile }
3 // { dg-options "-g -O0 -dA" }
4
5 template <class A> struct MisplacedDbg;
6 template<class T> struct MisplacedDbg<T*>;
7 struct Full;
8 template<> struct MisplacedDbg<Full>;
9
10 struct Arg;
11 typedef MisplacedDbg<Arg> Typedef1;
12 typedef MisplacedDbg<Arg*> Typedef2;
13 typedef MisplacedDbg<Full> Typedef3;
14
15 template<typename T> struct Base  {
16   virtual ~Base() {
17   }
18 };
19
20 template <>
21 struct MisplacedDbg<Full>  // { dg-function-on-line {_ZN12MisplacedDbgI4FullEC[12]Ev} }
22                            // { dg-function-on-line {_ZN12MisplacedDbgI4FullED0Ev} { target *-*-* } 21 }
23
24     : public Base<int> {
25 };
26
27 template <class T>
28 struct MisplacedDbg<T*>  // { dg-function-on-line {_ZN12MisplacedDbgIP3ArgEC[12]Ev} }
29                          // { dg-function-on-line {_ZN12MisplacedDbgIP3ArgED0Ev} { target *-*-* } 28 }
30     : public Base<int> {
31 };
32
33 template <class A>
34 struct MisplacedDbg  // { dg-function-on-line {_ZN12MisplacedDbgI3ArgEC[12]Ev} }
35                      // { dg-function-on-line {_ZN12MisplacedDbgI3ArgED0Ev} { target *-*-* } 34 }
36     : public Base<int> {
37 };
38
39 static MisplacedDbg<Arg> static_var1;
40 static MisplacedDbg<Arg*> static_var2;
41 static MisplacedDbg<Full> static_var3;