diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
| commit | 9f4dbff6669c8037f3b036bcf580d14f1a4f12a5 (patch) | |
| tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /test/CodeGenCXX/debug-info-template-explicit-specialization.cpp | |
| parent | f73d5f23a889b93d89ddef61ac0995df40286bb8 (diff) | |
Notes
Diffstat (limited to 'test/CodeGenCXX/debug-info-template-explicit-specialization.cpp')
| -rw-r--r-- | test/CodeGenCXX/debug-info-template-explicit-specialization.cpp | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp b/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp new file mode 100644 index 0000000000000..506c0d535751c --- /dev/null +++ b/test/CodeGenCXX/debug-info-template-explicit-specialization.cpp @@ -0,0 +1,93 @@ +// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -g %s -o - -fno-standalone-debug | FileCheck %s + +// Run again with -gline-tables-only and verify we don't crash. We won't output +// type info at all. +// RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -g %s -o - -gline-tables-only | FileCheck %s -check-prefix LINES-ONLY + +// LINES-ONLY-NOT: DW_TAG_structure_type + +template <typename T> +struct a { +}; +extern template class a<int>; +// CHECK-NOT: ; [ DW_TAG_structure_type ] [a<int>] + +template <typename T> +struct b { +}; +extern template class b<int>; +b<int> bi; +// CHECK: ; [ DW_TAG_structure_type ] [b<int>] {{.*}} [def] + +template <typename T> +struct c { + void f() {} +}; +extern template class c<int>; +c<int> ci; +// CHECK: ; [ DW_TAG_structure_type ] [c<int>] {{.*}} [decl] + +template <typename T> +struct d { + void f(); +}; +extern template class d<int>; +d<int> di; +// CHECK: ; [ DW_TAG_structure_type ] [d<int>] {{.*}} [def] + +template <typename T> +struct e { + void f(); +}; +template <typename T> +void e<T>::f() { +} +extern template class e<int>; +e<int> ei; +// 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. +// CHECK: ; [ DW_TAG_structure_type ] [e<int>] {{.*}} [def] + +template <typename T> +struct f { + void g(); +}; +extern template class f<int>; +template <typename T> +void f<T>::g() { +} +f<int> fi; +// CHECK: ; [ DW_TAG_structure_type ] [f<int>] {{.*}} [def] + +template <typename T> +struct g { + void f(); +}; +template <> +void g<int>::f(); +extern template class g<int>; +g<int> gi; +// CHECK: ; [ DW_TAG_structure_type ] [g<int>] {{.*}} [def] + +template <typename T> +struct h { +}; +template class h<int>; +// CHECK: ; [ DW_TAG_structure_type ] [h<int>] {{.*}} [def] + +template <typename T> +struct i { + void f() {} +}; +template<> void i<int>::f(); +extern template class i<int>; +i<int> ii; +// CHECK: ; [ DW_TAG_structure_type ] [i<int>] {{.*}} [def] + +template <typename T1, typename T2 = T1> +struct j { +}; +extern template class j<int>; +j<int> jj; +// CHECK: ; [ DW_TAG_structure_type ] [j<int, int>] |
