Files
clang-p2996/lldb/test/API/lang/cpp/enum_promotion/main.cpp
Ilia Kuklin f30c891464 [lldb] Analyze enum promotion type during parsing (#115005)
The information about an enum's best promotion type is discarded after
compilation and is not present in debug info. This patch repeats the
same analysis of each enum value as in the front-end to determine the
best promotion type during DWARF info parsing.

Fixes #86989
2025-02-13 22:08:31 +05:00

23 lines
760 B
C++

enum EnumUChar { UChar = 1 };
enum EnumUShort { UShort = 0x101 };
enum EnumUInt { UInt = 0x10001 };
enum EnumSLong { SLong = 0x100000001 };
enum EnumULong { ULong = 0xFFFFFFFFFFFFFFF0 };
enum EnumNChar { NChar = -1 };
enum EnumNShort { NShort = -0x101 };
enum EnumNInt { NInt = -0x10001 };
enum EnumNLong { NLong = -0x100000001 };
int main() {
auto UChar_promoted = +EnumUChar::UChar;
auto UShort_promoted = +EnumUShort::UShort;
auto UInt_promoted = +EnumUInt::UInt;
auto SLong_promoted = +EnumSLong::SLong;
auto ULong_promoted = +EnumULong::ULong;
auto NChar_promoted = +EnumNChar::NChar;
auto NShort_promoted = +EnumNShort::NShort;
auto NInt_promoted = +EnumNInt::NInt;
auto NLong_promoted = +EnumNLong::NLong;
return 0; // break here
}