xref: /llvm-project/clang/test/CodeGenCXX/debug-info-fwd-template-param.cpp (revision 1787f8122125762fb4e492f72e7c886e6e80d019)
1*1787f812SPaul Robinson // RUN: %clang_cc1 %s -triple=%itanium_abi_triple -debug-info-kind=limited -debug-forward-template-params -emit-llvm -o - | FileCheck --check-prefix=CHILD %s
2*1787f812SPaul Robinson // RUN: %clang_cc1 %s -triple=%itanium_abi_triple -debug-info-kind=limited -emit-llvm -o - | FileCheck --check-prefix=NONE %s
3*1787f812SPaul Robinson // A DWARF forward declaration of a template instantiation should have template
4*1787f812SPaul Robinson // parameter children (if we ask for them).
5*1787f812SPaul Robinson 
6*1787f812SPaul Robinson template<typename T> class A;
7*1787f812SPaul Robinson A<int> *p;
8*1787f812SPaul Robinson 
9*1787f812SPaul Robinson // CHILD:      !DICompositeType(tag: DW_TAG_class_type, name: "A<int>"
10*1787f812SPaul Robinson // CHILD-SAME:     flags: DIFlagFwdDecl
11*1787f812SPaul Robinson // CHILD-SAME:     templateParams: [[PARAM_LIST:![0-9]*]]
12*1787f812SPaul Robinson // CHILD:      [[PARAM_LIST]] = !{[[PARAM:![0-9]*]]}
13*1787f812SPaul Robinson // CHILD:      [[PARAM]] = !DITemplateTypeParameter(name: "T",
14*1787f812SPaul Robinson // CHILD-SAME:     type: [[BTYPE:![0-9]*]]
15*1787f812SPaul Robinson // CHILD:      [[BTYPE]] = !DIBasicType(name: "int"
16*1787f812SPaul Robinson 
17*1787f812SPaul Robinson // NONE:       !DICompositeType(tag: DW_TAG_class_type, name: "A<int>"
18*1787f812SPaul Robinson // NONE-SAME:      flags: DIFlagFwdDecl
19*1787f812SPaul Robinson // NONE-NOT:       templateParams:
20*1787f812SPaul Robinson // NONE-SAME:      )
21