Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / test / Shell / SymbolFile / DWARF / split-dwarf-expression-eval-bug.cpp
blob4a8004ddd287f6dd4e3ccec6ba4b44a6f93a2c88
1 // This tests a crash which occured under very specific circumstances. The
2 // interesting aspects of this test are:
3 // - we print a global variable from one compile unit
4 // - we are stopped in a member function of a class in a namespace
5 // - that namespace is also present in a third file, which also has a global
6 // variable
8 // UNSUPPORTED: system-darwin, system-windows
10 // RUN: %clang_host -c -gsplit-dwarf -g %s -o %t1.o -DONE
11 // RUN: %clang_host -c -gsplit-dwarf -g %s -o %t2.o -DTWO
12 // RUN: %clang_host -c -gsplit-dwarf -g %s -o %t3.o -DTHREE
13 // RUN: %clang_host %t1.o %t2.o %t3.o -o %t
14 // RUN: %lldb %t -o "br set -n foo" -o run -o "expression bool_in_first_cu" -o exit \
15 // RUN: | FileCheck %s
17 // CHECK: (lldb) expression bool_in_first_cu
18 // CHECK: (bool) $0 = true
21 #if defined(ONE)
22 bool bool_in_first_cu = true;
23 #elif defined(TWO)
24 bool bool_in_second_cu = true;
26 namespace NS {
27 void f() {}
29 #elif defined(THREE)
30 namespace NS {
31 struct S {
32 void foo() {}
36 int main() { NS::S().foo(); }
37 #endif