This is mostly to support Swift `let`, but I found a way to get MSVC to
emit a local `S_CONSTANT` (see test).
I saw the note about `MakeConstantLocalExpression` at
2e34fecf02/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp (L2177)
but couldn't repro with local or global (emitted as `S_LDATA32` in both
cases).
25 lines
527 B
Plaintext
25 lines
527 B
Plaintext
# REQUIRES: msvc
|
|
|
|
# Test that we can display local S_CONSTANT records.
|
|
# MSVC emits S_CONSTANT for static const locals; clang-cl does not.
|
|
# RUN: split-file %s %t
|
|
# RUN: %build --compiler=msvc --nodefaultlib -o %t.exe -- %t/main.cpp
|
|
# RUN: %lldb -f %t.exe -s %t/commands.input 2>&1 | FileCheck %s
|
|
|
|
#--- main.cpp
|
|
|
|
int main() {
|
|
static const int kConstant = 42;
|
|
return kConstant;
|
|
}
|
|
|
|
#--- commands.input
|
|
|
|
settings set stop-line-count-after 0
|
|
break set -n main
|
|
run
|
|
frame variable
|
|
quit
|
|
|
|
# CHECK: (const int) {{.*}}kConstant = 42
|