llvm-project/clang/test/DebugInfo/Generic/enum-extensibility.c
Michael Buch 3f3bc4853e
[clang][test][DebugInfo] Move debug-info tests from CodeGen to DebugInfo directory (#154311)
This patch works towards consolidating all Clang debug-info into the
`clang/test/DebugInfo` directory
(https://discourse.llvm.org/t/clang-test-location-of-clang-debug-info-tests/87958).

Here we move only the `clang/test/CodeGen` tests.

The list of files i came up with is:
1. searched for anything with `*debug-info*` in the filename
2. searched for occurrences of `debug-info-kind` in the tests

I created a couple of subdirectories in `clang/test/DebugInfo` where I
thought it made sense (mostly when the tests were target-specific).

There's a couple of tests in `clang/test/CodeGen` that still set
`-debug-info-kind`. They probably don't need to do that, but I'm not
changing that as part of this PR.
2025-08-19 18:25:13 +01:00

50 lines
1.5 KiB
C

// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
// CHECK-NOT: enumKind
// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "ClosedEnum"
// CHECK-SAME: enumKind: DW_APPLE_ENUM_KIND_Closed)
// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "OpenEnum"
// CHECK-SAME: enumKind: DW_APPLE_ENUM_KIND_Open)
// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "ClosedFlagEnum"
// CHECK-SAME: enumKind: DW_APPLE_ENUM_KIND_Closed)
// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "OpenFlagEnum"
// CHECK-SAME: enumKind: DW_APPLE_ENUM_KIND_Open)
// CHECK: !DICompositeType(tag: DW_TAG_enumeration_type, name: "MixedEnum"
// CHECK-SAME: enumKind: DW_APPLE_ENUM_KIND_Open)
enum Enum {
E0, E1
};
enum FlagEnum {
FE0 = 1 << 0, FE1 = 1 << 1
};
enum __attribute__((enum_extensibility(closed))) ClosedEnum {
A0, A1
};
enum __attribute__((enum_extensibility(open))) OpenEnum {
B0, B1
};
enum __attribute__((enum_extensibility(closed),flag_enum)) ClosedFlagEnum {
C0 = 1 << 0, C1 = 1 << 1
};
enum __attribute__((enum_extensibility(open),flag_enum)) OpenFlagEnum {
D0 = 1 << 0, D1 = 1 << 1
};
enum __attribute__((enum_extensibility(open), enum_extensibility(closed))) MixedEnum {
M0, M1
};
enum Enum e;
enum FlagEnum fe;
enum ClosedEnum ce;
enum OpenEnum oe;
enum ClosedFlagEnum cfe;
enum OpenFlagEnum ofe;
enum MixedEnum me;