blob: 6dfffb61144b0045b9fd28ce4f86b7c14d39cae6 [file] [log] [blame]
Pete Coopera8290ac2014-03-04 02:56:59 +00001// RUN: %clang_cc1 -S -emit-llvm -g %s -o - -triple=x86_64-unknown-unknown | FileCheck %s
David Blaikie0e716b42014-03-03 23:48:23 +00002
3template <typename T>
4struct a {
5};
6extern template class a<int>;
7// CHECK-NOT: ; [ DW_TAG_structure_type ] [a<int>]
8
9template <typename T>
10struct b {
11};
12extern template class b<int>;
13b<int> bi;
14// CHECK: ; [ DW_TAG_structure_type ] [b<int>] {{.*}} [def]
15
16template <typename T>
17struct c {
18 void f() {}
19};
20extern template class c<int>;
21c<int> ci;
22// CHECK: ; [ DW_TAG_structure_type ] [c<int>] {{.*}} [decl]
23
24template <typename T>
25struct d {
26 void f();
27};
28extern template class d<int>;
29d<int> di;
30// CHECK: ; [ DW_TAG_structure_type ] [d<int>] {{.*}} [def]
31
32template <typename T>
33struct e {
34 void f();
35};
36template <typename T>
37void e<T>::f() {
38}
39extern template class e<int>;
40e<int> ei;
41// CHECK: ; [ DW_TAG_structure_type ] [e<int>] {{.*}} [decl]
42
43template <typename T>
44struct f {
45 void g();
46};
47extern template class f<int>;
48template <typename T>
49void f<T>::g() {
50}
51f<int> fi;
52// Is this right? We don't seem to emit a def for 'f<int>::g' (even if it is
53// called in this translation unit) so I guess if we're relying on its
54// definition to be wherever the explicit instantiation definition is, we can do
55// the same for the debug info.
56// CHECK: ; [ DW_TAG_structure_type ] [f<int>] {{.*}} [decl]
57
58template <typename T>
59struct g {
60 void f();
61};
62template <>
63void g<int>::f();
64extern template class g<int>;
65g<int> gi;
66// CHECK: ; [ DW_TAG_structure_type ] [g<int>] {{.*}} [def]
67
68template <typename T>
69struct h {
70};
71template class h<int>;
72// CHECK: ; [ DW_TAG_structure_type ] [h<int>] {{.*}} [def]