4 // Test that we can display S_CONSTANT records.
6 // RUN: llvm-mc -filetype=obj -triple=x86_64-pc-win32 %p/Inputs/s_constant.s > %t.obj
7 // RUN: %build --compiler=clang-cl --nodefaultlib --mode=link -o %t.exe -- %t.obj
8 // RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -s \
9 // RUN: %p/Inputs/s_constant.lldbinit | FileCheck %s
11 // clang-cl cannot generate S_CONSTANT records, but we need to test that we can
12 // handle them for compatibility with MSVC, which does emit them. This test
13 // case was generated by compiling this file with MSVC and copying the bytes
14 // that they emit for S_CONSTANT records. Then we compile the same code with
15 // clang to get a .s file, and replace all S_LDATA32 records with the bytes from
16 // the S_CONSTANT records. This way we end up with a .s file that contains
17 // symbol records that clang-cl won't generate.
22 enum LargeUnsignedEnum
: unsigned long long {
25 LUE_C
= 18446744073709551600ULL,
28 enum LargeSignedEnum
: long long {
30 LSE_B
= 9223372036854775000LL,
31 LSE_C
= -9223372036854775000LL,
34 enum UnsignedEnum
: unsigned int {
40 enum SignedEnum
: int {
46 enum SmallUnsignedEnum
: unsigned char {
52 enum SmallSignedEnum
: char {
61 using namespace A::B::C
;
63 constexpr LargeUnsignedEnum GlobalLUEA
= LUE_A
;
64 constexpr LargeUnsignedEnum GlobalLUEB
= LUE_B
;
65 constexpr LargeUnsignedEnum GlobalLUEC
= LUE_C
;
67 constexpr LargeSignedEnum GlobalLSEA
= LSE_A
;
68 constexpr LargeSignedEnum GlobalLSEB
= LSE_B
;
69 constexpr LargeSignedEnum GlobalLSEC
= LSE_C
;
71 constexpr UnsignedEnum GlobalUEA
= UE_A
;
72 constexpr UnsignedEnum GlobalUEB
= UE_B
;
73 constexpr UnsignedEnum GlobalUEC
= UE_C
;
75 constexpr SignedEnum GlobalSEA
= SE_A
;
76 constexpr SignedEnum GlobalSEB
= SE_B
;
77 constexpr SignedEnum GlobalSEC
= SE_C
;
79 constexpr SmallUnsignedEnum GlobalSUEA
= SUE_A
;
80 constexpr SmallUnsignedEnum GlobalSUEB
= SUE_B
;
81 constexpr SmallUnsignedEnum GlobalSUEC
= SUE_C
;
83 constexpr SmallSignedEnum GlobalSSEA
= SSE_A
;
84 constexpr SmallSignedEnum GlobalSSEB
= SSE_B
;
85 constexpr SmallSignedEnum GlobalSSEC
= SSE_C
;
87 int main(int argc
, char **argv
) {
91 // CHECK: (const A::B::C::LargeUnsignedEnum) GlobalLUEA = LUE_A
92 // CHECK: (const A::B::C::LargeUnsignedEnum) GlobalLUEB = LUE_B
94 // X-FAIL: Something is outputting bad debug info here, maybe cl.
95 // CHECK: (const A::B::C::LargeUnsignedEnum) GlobalLUEC = {{.*}}
97 // CHECK: (const A::B::C::LargeSignedEnum) GlobalLSEA = LSE_A
98 // CHECK: (const A::B::C::LargeSignedEnum) GlobalLSEB = LSE_B
99 // CHECK: (const A::B::C::LargeSignedEnum) GlobalLSEC = LSE_C
101 // CHECK: (const A::B::C::UnsignedEnum) GlobalUEA = UE_A
102 // CHECK: (const A::B::C::UnsignedEnum) GlobalUEB = UE_B
103 // CHECK: (const A::B::C::UnsignedEnum) GlobalUEC = UE_C
105 // CHECK: (const A::B::C::SignedEnum) GlobalSEA = SE_A
106 // CHECK: (const A::B::C::SignedEnum) GlobalSEB = SE_B
107 // CHECK: (const A::B::C::SignedEnum) GlobalSEC = SE_C
109 // CHECK: (const A::B::C::SmallUnsignedEnum) GlobalSUEA = SUE_A
110 // CHECK: (const A::B::C::SmallUnsignedEnum) GlobalSUEB = SUE_B
111 // CHECK: (const A::B::C::SmallUnsignedEnum) GlobalSUEC = SUE_C
113 // CHECK: (const A::B::C::SmallSignedEnum) GlobalSSEA = SSE_A
114 // CHECK: (const A::B::C::SmallSignedEnum) GlobalSSEB = SSE_B
115 // CHECK: (const A::B::C::SmallSignedEnum) GlobalSSEC = SSE_C