2015-10-08 12:24:12 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=limited %s -o - | FileCheck %s
|
2014-03-05 05:33:26 +08:00
|
|
|
|
2018-08-31 21:56:14 +08:00
|
|
|
// Run again with -gline-tables-only or -gline-directives-only and verify we don't crash. We won't output
|
2014-03-05 05:33:26 +08:00
|
|
|
// type info at all.
|
2015-10-08 12:24:12 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=line-tables-only %s -o - | FileCheck %s -check-prefix LINES-ONLY
|
2018-08-31 21:56:14 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -debug-info-kind=line-directives-only %s -o - | FileCheck %s -check-prefix LINES-ONLY
|
2014-03-05 05:33:26 +08:00
|
|
|
|
2015-04-30 00:40:08 +08:00
|
|
|
// LINES-ONLY-NOT: !DICompositeType(tag: DW_TAG_structure_type
|
2014-03-04 07:48:23 +08:00
|
|
|
|
2016-04-24 05:08:27 +08:00
|
|
|
// "h" is at the top because it's in the compile unit's retainedTypes: list.
|
|
|
|
// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "h<int>"
|
|
|
|
// CHECK-NOT: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: ){{$}}
|
|
|
|
|
2014-03-04 07:48:23 +08:00
|
|
|
template <typename T>
|
|
|
|
struct a {
|
|
|
|
};
|
|
|
|
extern template class a<int>;
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK-NOT: DICompositeType(tag: DW_TAG_structure_type, name: "a<int>"
|
2014-03-04 07:48:23 +08:00
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
struct b {
|
|
|
|
};
|
|
|
|
extern template class b<int>;
|
|
|
|
b<int> bi;
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
struct c {
|
|
|
|
void f() {}
|
|
|
|
};
|
|
|
|
extern template class c<int>;
|
|
|
|
c<int> ci;
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "c<int>"
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-SAME: DIFlagFwdDecl
|
2014-03-04 07:48:23 +08:00
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
struct d {
|
|
|
|
void f();
|
|
|
|
};
|
|
|
|
extern template class d<int>;
|
|
|
|
d<int> di;
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "d<int>"
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-NOT: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: ){{$}}
|
2014-03-04 07:48:23 +08:00
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
struct e {
|
|
|
|
void f();
|
|
|
|
};
|
|
|
|
template <typename T>
|
|
|
|
void e<T>::f() {
|
|
|
|
}
|
|
|
|
extern template class e<int>;
|
|
|
|
e<int> ei;
|
2014-03-04 11:08:14 +08:00
|
|
|
// There's no guarantee that the out of line definition will appear before the
|
|
|
|
// explicit template instantiation definition, so conservatively emit the type
|
|
|
|
// definition here.
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "e<int>"
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-NOT: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: ){{$}}
|
2014-03-04 07:48:23 +08:00
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
struct f {
|
|
|
|
void g();
|
|
|
|
};
|
|
|
|
extern template class f<int>;
|
|
|
|
template <typename T>
|
|
|
|
void f<T>::g() {
|
|
|
|
}
|
|
|
|
f<int> fi;
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "f<int>"
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-NOT: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: ){{$}}
|
2014-03-04 07:48:23 +08:00
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
struct g {
|
|
|
|
void f();
|
|
|
|
};
|
|
|
|
template <>
|
|
|
|
void g<int>::f();
|
|
|
|
extern template class g<int>;
|
|
|
|
g<int> gi;
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "g<int>"
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-NOT: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: ){{$}}
|
2014-03-04 07:48:23 +08:00
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
struct h {
|
|
|
|
};
|
|
|
|
template class h<int>;
|
2014-03-04 11:08:14 +08:00
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
struct i {
|
|
|
|
void f() {}
|
|
|
|
};
|
|
|
|
template<> void i<int>::f();
|
|
|
|
extern template class i<int>;
|
|
|
|
i<int> ii;
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "i<int>"
|
2015-03-04 01:25:55 +08:00
|
|
|
// CHECK-NOT: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: ){{$}}
|
2014-04-03 02:21:09 +08:00
|
|
|
|
|
|
|
template <typename T1, typename T2 = T1>
|
|
|
|
struct j {
|
|
|
|
};
|
|
|
|
extern template class j<int>;
|
|
|
|
j<int> jj;
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "j<int, int>"
|
2014-12-17 07:49:18 +08:00
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
struct k {
|
|
|
|
};
|
|
|
|
template <>
|
|
|
|
struct k<int>;
|
|
|
|
template struct k<int>;
|
2015-04-30 00:40:08 +08:00
|
|
|
// CHECK-NOT: !DICompositeType(tag: DW_TAG_structure_type, name: "k<int>"
|
2016-09-13 09:13:19 +08:00
|
|
|
|
|
|
|
// CHECK: DICompositeType(tag: DW_TAG_structure_type, name: "b<int>"
|
|
|
|
// CHECK-NOT: DIFlagFwdDecl
|
|
|
|
// CHECK-SAME: ){{$}}
|