1 // RUN: %clang_cc1 %s -std=c++11 -triple=x86_64-pc-windows-msvc -debug-info-kind=limited -gcodeview -emit-llvm -o - | FileCheck %s
4 enum InnerEnum
{ _BUF_SIZE
= 1 };
5 typedef int InnerTypedef
;
6 enum { InnerEnumerator
= 2 };
7 struct InnerStruct
{ };
10 union { int i2
; } unnamed_union
;
12 struct { int i4
; } unnamed_struct
;
16 // CHECK: ![[INNERENUM:[0-9]+]] = !DICompositeType(tag: DW_TAG_enumeration_type, name: "InnerEnum", {{.*}})
17 // CHECK: ![[HASNESTED:[0-9]+]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "HasNested",
18 // CHECK-SAME: elements: ![[MEMBERS:[0-9]+]],
20 // CHECK: ![[MEMBERS]] = !{![[INNERENUM]], ![[INNERTYPEDEF:[0-9]+]], ![[UNNAMEDENUM:[0-9]+]], ![[INNERSTRUCT:[0-9]+]], ![[ANONYMOUS_UNION:[0-9]+]], ![[UNNAMED_UNION_TYPE:[0-9]+]], ![[UNNAMED_UNION:[0-9]+]], ![[ANONYMOUS_STRUCT:[0-9]+]], ![[UNNAMED_STRUCT_TYPE:[0-9]+]], ![[UNNAMED_STRUCT:[0-9]+]]}
22 // CHECK: ![[INNERTYPEDEF]] = !DIDerivedType(tag: DW_TAG_typedef, name: "InnerTypedef", scope: ![[HASNESTED]]{{.*}})
24 // CHECK: ![[UNNAMEDENUM]] = !DICompositeType(tag: DW_TAG_enumeration_type, scope: ![[HASNESTED]],
25 // CHECK-SAME: elements: ![[UNNAMEDMEMBERS:[0-9]+]],
26 // CHECK: ![[UNNAMEDMEMBERS]] = !{![[INNERENUMERATOR:[0-9]+]]}
27 // CHECK: ![[INNERENUMERATOR]] = !DIEnumerator(name: "InnerEnumerator", value: 2)
29 // CHECK: ![[INNERSTRUCT]] = !DICompositeType(tag: DW_TAG_structure_type, name: "InnerStruct"
30 // CHECK-SAME: flags: DIFlagFwdDecl
32 // CHECK: ![[ANONYMOUS_UNION]] = !DIDerivedType(tag: DW_TAG_member,
33 // CHECK-SAME: baseType: ![[ANONYMOUS_UNION_TYPE:[0-9]+]]
34 // CHECK: ![[ANONYMOUS_UNION_TYPE]] = distinct !DICompositeType(tag: DW_TAG_union_type,
35 // CHECK-SAME: elements: ![[ANONYMOUS_UNION_MEMBERS:[0-9]+]], identifier: ".?AT<unnamed-type-$S1>@HasNested@@")
36 // CHECK: ![[ANONYMOUS_UNION_MEMBERS]] = !{![[ANONYMOUS_UNION_MEMBER:[0-9]+]]}
37 // CHECK: ![[ANONYMOUS_UNION_MEMBER]] = !DIDerivedType(tag: DW_TAG_member, name: "i1"
39 // CHECK: ![[UNNAMED_UNION_TYPE]] = distinct !DICompositeType(tag: DW_TAG_union_type, name: "<unnamed-type-unnamed_union>"
40 // CHECK-SAME: elements: ![[UNNAMED_UNION_MEMBERS:[0-9]+]], identifier: ".?AT<unnamed-type-unnamed_union>@HasNested@@")
41 // CHECK: ![[UNNAMED_UNION_MEMBERS]] = !{![[UNNAMED_UNION_MEMBER:[0-9]+]]}
42 // CHECK: ![[UNNAMED_UNION_MEMBER]] = !DIDerivedType(tag: DW_TAG_member, name: "i2"
43 // CHECK: ![[UNNAMED_UNION]] = !DIDerivedType(tag: DW_TAG_member, name: "unnamed_union"
44 // CHECK-SAME: baseType: ![[UNNAMED_UNION_TYPE]]
46 // CHECK: ![[ANONYMOUS_STRUCT]] = !DIDerivedType(tag: DW_TAG_member
47 // CHECK-SAME: baseType: ![[ANONYMOUS_STRUCT_TYPE:[0-9]+]]
48 // CHECK: ![[ANONYMOUS_STRUCT_TYPE]] = distinct !DICompositeType(tag: DW_TAG_structure_type
49 // CHECK-SAME: elements: ![[ANONYMOUS_STRUCT_MEMBERS:[0-9]+]], identifier: ".?AU<unnamed-type-$S2>@HasNested@@")
50 // CHECK: ![[ANONYMOUS_STRUCT_MEMBERS]] = !{![[ANONYMOUS_STRUCT_MEMBER:[0-9]+]]}
51 // CHECK: ![[ANONYMOUS_STRUCT_MEMBER]] = !DIDerivedType(tag: DW_TAG_member, name: "i3"
53 // CHECK: ![[UNNAMED_STRUCT_TYPE]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "<unnamed-type-unnamed_struct>"
54 // CHECK-SAME: elements: ![[UNNAMED_STRUCT_MEMBERS:[0-9]+]], identifier: ".?AU<unnamed-type-unnamed_struct>@HasNested@@")
55 // CHECK: ![[UNNAMED_STRUCT_MEMBERS]] = !{![[UNNAMED_STRUCT_MEMBER:[0-9]+]]}
56 // CHECK: ![[UNNAMED_STRUCT_MEMBER]] = !DIDerivedType(tag: DW_TAG_member, name: "i4"
57 // CHECK: ![[UNNAMED_STRUCT]] = !DIDerivedType(tag: DW_TAG_member, name: "unnamed_struct"
58 // CHECK-SAME: baseType: ![[UNNAMED_STRUCT_TYPE]]