blob: 86380392a20a23c5201700171f2c59eb9c38f387 [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;
David Blaikief7f21852014-03-04 03:08:14 +000041// There's no guarantee that the out of line definition will appear before the
42// explicit template instantiation definition, so conservatively emit the type
43// definition here.
44// CHECK: ; [ DW_TAG_structure_type ] [e<int>] {{.*}} [def]
David Blaikie0e716b42014-03-03 23:48:23 +000045
46template <typename T>
47struct f {
48 void g();
49};
50extern template class f<int>;
51template <typename T>
52void f<T>::g() {
53}
54f<int> fi;
David Blaikief7f21852014-03-04 03:08:14 +000055// CHECK: ; [ DW_TAG_structure_type ] [f<int>] {{.*}} [def]
David Blaikie0e716b42014-03-03 23:48:23 +000056
57template <typename T>
58struct g {
59 void f();
60};
61template <>
62void g<int>::f();
63extern template class g<int>;
64g<int> gi;
65// CHECK: ; [ DW_TAG_structure_type ] [g<int>] {{.*}} [def]
66
67template <typename T>
68struct h {
69};
70template class h<int>;
71// CHECK: ; [ DW_TAG_structure_type ] [h<int>] {{.*}} [def]
David Blaikief7f21852014-03-04 03:08:14 +000072
73template <typename T>
74struct i {
75 void f() {}
76};
77template<> void i<int>::f();
78extern template class i<int>;
79i<int> ii;
80// CHECK: ; [ DW_TAG_structure_type ] [i<int>] {{.*}} [def]