brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1023 B · b02eea6 Raw
38 lines · cpp
1// This tests a crash which occured under very specific circumstances. The2// interesting aspects of this test are:3// - we print a global variable from one compile unit4// - we are stopped in a member function of a class in a namespace5// - that namespace is also present in a third file, which also has a global6//   variable7 8// UNSUPPORTED: system-darwin, system-windows9 10// RUN: %clangxx_host -c -gsplit-dwarf -g %s -o %t1.o -DONE11// RUN: %clangxx_host -c -gsplit-dwarf -g %s -o %t2.o -DTWO12// RUN: %clangxx_host -c -gsplit-dwarf -g %s -o %t3.o -DTHREE13// RUN: %clangxx_host %t1.o %t2.o %t3.o -o %t14// RUN: %lldb %t -o "br set -n foo" -o run -o "expression bool_in_first_cu" -o exit \15// RUN:   | FileCheck %s16 17// CHECK: (lldb) expression bool_in_first_cu18// CHECK: (bool) $0 = true19 20 21#if defined(ONE)22bool bool_in_first_cu = true;23#elif defined(TWO)24bool bool_in_second_cu = true;25 26namespace NS {27void f() {}28}29#elif defined(THREE)30namespace NS {31struct S {32  void foo() {}33};34}35 36int main() { NS::S().foo(); }37#endif38