1 // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=limited %s -o - | FileCheck %s
3 // Make sure this still works with constructor homing.
4 // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=constructor %s -o - | FileCheck %s
6 // Run again with -gline-tables-only or -gline-directives-only and verify we don't crash. We won't output
8 // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=line-tables-only %s -o - | FileCheck %s -check-prefix LINES-ONLY
9 // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=line-directives-only %s -o - | FileCheck %s -check-prefix LINES-ONLY
11 // LINES-ONLY-NOT: !DICompositeType(tag: DW_TAG_structure_type
13 // "h" is at the top because it's in the compile unit's retainedTypes: list.
14 // CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "h<int>"
15 // CHECK-NOT: DIFlagFwdDecl
21 extern template class a
<int>;
22 // CHECK-NOT: DICompositeType(tag: DW_TAG_structure_type, name: "a<int>"
27 extern template class b
<int>;
34 extern template class c
<int>;
36 // CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "c<int>"
37 // CHECK-SAME: DIFlagFwdDecl
43 extern template class d
<int>;
45 // CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "d<int>"
46 // CHECK-NOT: DIFlagFwdDecl
56 extern template class e
<int>;
58 // There's no guarantee that the out of line definition will appear before the
59 // explicit template instantiation definition, so conservatively emit the type
61 // CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "e<int>"
62 // CHECK-NOT: DIFlagFwdDecl
69 extern template class f
<int>;
74 // CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "f<int>"
75 // CHECK-NOT: DIFlagFwdDecl
84 extern template class g
<int>;
86 // CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "g<int>"
87 // CHECK-NOT: DIFlagFwdDecl
93 template class h
<int>;
99 template<> void i
<int>::f();
100 extern template class i
<int>;
102 // CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "i<int>"
103 // CHECK-NOT: DIFlagFwdDecl
104 // CHECK-SAME: ){{$}}
106 template <typename T1
, typename T2
= T1
>
109 extern template class j
<int>;
111 template <typename T
>
114 j_wrap
<j
<int>> j_wrap_j
;
115 // CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j<int, int>"
116 // CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j_wrap<j<int, int> >"
118 template <typename T
>
123 template struct k
<int>;
124 // CHECK-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "k<int>"
126 // CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "b<int>"
127 // CHECK-NOT: DIFlagFwdDecl
128 // CHECK-SAME: ){{$}}