1*a9f5119aSYuze Chi // RUN: %clang_cc1 -x c++ -debug-info-kind=limited -triple bpf-linux-gnu -emit-llvm %s -o - | FileCheck %s
2*a9f5119aSYuze Chi
3*a9f5119aSYuze Chi namespace foo {
4*a9f5119aSYuze Chi
5*a9f5119aSYuze Chi template <typename T>
6*a9f5119aSYuze Chi struct S {
7*a9f5119aSYuze Chi T x;
8*a9f5119aSYuze Chi };
9*a9f5119aSYuze Chi
10*a9f5119aSYuze Chi extern S<char> s;
11*a9f5119aSYuze Chi
test(void)12*a9f5119aSYuze Chi int test(void) {
13*a9f5119aSYuze Chi return s.x;
14*a9f5119aSYuze Chi }
15*a9f5119aSYuze Chi
16*a9f5119aSYuze Chi } // namespace foo
17*a9f5119aSYuze Chi
18*a9f5119aSYuze Chi // CHECK: distinct !DIGlobalVariable(name: "s", scope: ![[NAMESPACE:[0-9]+]],{{.*}} type: ![[STRUCT_TYPE:[0-9]+]], isLocal: false, isDefinition: false)
19*a9f5119aSYuze Chi // CHECK: ![[NAMESPACE]] = !DINamespace(name: "foo", scope: null)
20*a9f5119aSYuze Chi // CHECK: ![[STRUCT_TYPE]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S<char>",{{.*}}size: 8, flags: DIFlagTypePassByValue, elements: ![[ELEMENT_TYPE:[0-9]+]], templateParams: ![[TEMPLATE_TYPE:[0-9]+]], identifier: "_ZTSN3foo1SIcEE")
21*a9f5119aSYuze Chi // CHECK: ![[ELEMENT_TYPE]] = !{![[ELEMENT_TYPE:[0-9]+]]}
22*a9f5119aSYuze Chi // CHECK: ![[ELEMENT_TYPE]] = !DIDerivedType(tag: DW_TAG_member, name: "x",{{.*}} baseType: ![[BASE_TYPE:[0-9]+]], size: 8)
23*a9f5119aSYuze Chi // CHECK: ![[BASE_TYPE]] = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
24*a9f5119aSYuze Chi // CHECK: ![[TEMPLATE_TYPE]] = !{![[TEMPLATE_TYPE:[0-9]+]]}
25*a9f5119aSYuze Chi // CHECK: ![[TEMPLATE_TYPE]] = !DITemplateTypeParameter(name: "T", type: ![[BASE_TYPE]])
26