OSDN Git Service

Use -fno-merge-debug-string for some dwarf tests
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / debug / dwarf2 / template-params-6.C
1 // Contributed by Dodji Seketeli <dodji@redhat.com>
2 // Origin PR debug/30161
3 // { dg-options "-g -dA -fno-merge-debug-strings" }
4 // { dg-final { scan-assembler-times "DW_TAG_GNU_template_template_param" 2 } }
5 // { dg-final { scan-assembler-times "\"vector.0\".*?DW_AT_GNU_template_name" 1 } }
6 // { dg-final { scan-assembler-times ".ascii \"U.0\".*?DW_AT_name" 1 } }
7
8 template <class T>
9 struct vector_base
10 {
11     T tab[3 + 1];
12     static int get_sizeof_t()
13     {
14       return sizeof (tab);
15     }
16 };
17
18 template <class T>
19 struct vector : public vector_base<T>
20 {
21     static int get_sizeof_t()
22     {
23         return sizeof (T);
24     }
25     T member1;
26     T member2;
27 };
28
29 template <template <class T> class U>
30 struct bar
31 {
32   int foo()
33   {
34       return U<int>::get_sizeof_t ();
35   }
36 };
37
38
39 int
40 foo_func ()
41 {
42   bar<vector> b;
43   return b.foo ();
44 }