// 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 struct a { }; extern template class a; // CHECK-NOT: ; [ DW_TAG_structure_type ] [a] template struct b { }; extern template class b; b bi; // CHECK: ; [ DW_TAG_structure_type ] [b] {{.*}} [def] template struct c { void f() {} }; extern template class c; c ci; // CHECK: ; [ DW_TAG_structure_type ] [c] {{.*}} [decl] template struct d { void f(); }; extern template class d; d di; // CHECK: ; [ DW_TAG_structure_type ] [d] {{.*}} [def] template struct e { void f(); }; template void e::f() { } extern template class e; e 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] {{.*}} [def] template struct f { void g(); }; extern template class f; template void f::g() { } f fi; // CHECK: ; [ DW_TAG_structure_type ] [f] {{.*}} [def] template struct g { void f(); }; template <> void g::f(); extern template class g; g gi; // CHECK: ; [ DW_TAG_structure_type ] [g] {{.*}} [def] template struct h { }; template class h; // CHECK: ; [ DW_TAG_structure_type ] [h] {{.*}} [def] template struct i { void f() {} }; template<> void i::f(); extern template class i; i ii; // CHECK: ; [ DW_TAG_structure_type ] [i] {{.*}} [def] template struct j { }; extern template class j; j jj; // CHECK: ; [ DW_TAG_structure_type ] [j]