| 1 |
// RUN: %clang_cc1 -debug-info-kind=unused-types -emit-llvm -o - %s | FileCheck %s |
| 2 |
// RUN: %clang_cc1 -debug-info-kind=limited -emit-llvm -o - %s | FileCheck --check-prefix=NODBG %s |
| 3 |
using foo = int; |
| 4 |
class bar {}; |
| 5 |
enum class baz { BAZ }; |
| 6 |
|
| 7 |
void quux() { |
| 8 |
using x = int; |
| 9 |
class y {}; |
| 10 |
enum class z { Z }; |
| 11 |
} |
| 12 |
|
| 13 |
// CHECK: !DICompileUnit{{.+}}retainedTypes: [[RETTYPES:![0-9]+]] |
| 14 |
// CHECK: [[TYPE0:![0-9]+]] = !DICompositeType(tag: DW_TAG_enumeration_type, name: "baz" |
| 15 |
// CHECK: [[TYPE1:![0-9]+]] = !DIEnumerator(name: "BAZ" |
| 16 |
// CHECK: [[TYPE2:![0-9]+]] = !DICompositeType(tag: DW_TAG_enumeration_type, name: "z" |
| 17 |
// CHECK: [[TYPE3:![0-9]+]] = !DIEnumerator(name: "Z" |
| 18 |
// CHECK: [[RETTYPES]] = !{[[TYPE4:![0-9]+]], [[TYPE5:![0-9]+]], [[TYPE0]], {{![0-9]+}}, [[TYPE6:![0-9]+]], [[TYPE2]]} |
| 19 |
// CHECK: [[TYPE4]] = !DIDerivedType(tag: DW_TAG_typedef, name: "foo" |
| 20 |
// CHECK: [[TYPE5]] = distinct !DICompositeType(tag: DW_TAG_class_type, name: "bar" |
| 21 |
// CHECK: [[TYPE6]] = distinct !DICompositeType(tag: DW_TAG_class_type, name: "y" |
| 22 |
|
| 23 |
// NODBG-NOT: !DI{{CompositeType|Enumerator|DerivedType}} |
| 24 |
|
| 25 |
class unused_class; |
| 26 |
enum class unused_enum_class; |
| 27 |
|
| 28 |
// NODBG-NOT: name: "unused_ |