Skip to content

Commit 5ea1249

Browse files
committed
Add clang test
1 parent c14676e commit 5ea1249

File tree

2 files changed

+32
-104
lines changed

2 files changed

+32
-104
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// RUN: %clang_cc1 -debug-info-kind=unused-types -emit-llvm -o - %s | FileCheck %s
2+
3+
struct Type {
4+
enum { Unused };
5+
int value = 0;
6+
};
7+
int main() {
8+
Type t;
9+
return t.value;
10+
}
11+
12+
// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type
13+
// CHECK-SAME: scope: ![[STRUCT:[0-9]+]]
14+
// CHECK-SAME: baseType: ![[UINT:[0-9]+]]
15+
// CHECK-SAME: elements: ![[ELEMENTS:[0-9]+]]
16+
17+
// CHECK: ![[STRUCT]] = distinct !DICompositeType(tag: DW_TAG_structure_type
18+
// CHECK-SAME: elements: ![[STRUCT_ELEMENTS:[0-9]+]]
19+
20+
// CHECK: ![[STRUCT_ELEMENTS]] = !{![[ENUM_MEMBER:[0-9]+]], ![[VALUE_MEMBER:[0-9]+]]}
21+
22+
// CHECK: ![[VALUE_MEMBER]] = !DIDerivedType(tag: DW_TAG_member
23+
// CHECK-SAME: name: "value"
24+
// CHECK-SAME: scope: ![[STRUCT]]
25+
// CHECK-SAME: baseType: ![[INT:[0-9]+]]
26+
27+
// CHECK: ![[INT]] = !DIBasicType(name: "int"
28+
29+
// CHECK: ![[UINT]] = !DIBasicType(name: "unsigned int"
30+
31+
// CHECK: ![[ELEMENTS]] = !{![[ENUMERATOR:[0-9]+]]}
32+
// CHECK: ![[ENUMERATOR]] = !DIEnumerator(name: "Unused", value: 0, isUnsigned: true)

llvm/test/DebugInfo/X86/nested_unused_enum.ll

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)