teak-llvm/lldb/packages/Python/lldbsuite/test/expression_command/top-level/dummy.cpp
Pavel Labath 042c752691 Make TestTopLevelExprs more robust in face of linker GC
Summary:
This test was failing in various configurations on linux in a fairly
unpredictible way. The success depended on whether the c++ abi library
was linked in statically or not and how well was the linker able to
strip parts of it. This introduces additional code to the "dummmy" test
executable, which ensures that all parts of the library needed to
evaluate the expressions are always present.

Reviewers: clayborg

Subscribers: srhines, tatyana-krasnukha, davide, lldb-commits

Differential Revision: https://reviews.llvm.org/D39727

llvm-svn: 317678
2017-11-08 10:48:50 +00:00

16 lines
513 B
C++

#include <stdio.h>
// These are needed to make sure that the linker does not strip the parts of the
// C++ abi library that are necessary to execute the expressions in the
// debugger. It would be great if we did not need to do this, but the fact that
// LLDB cannot conjure up the abi library on demand is not relevant for testing
// top level expressions.
struct DummyA {};
struct DummyB : public virtual DummyA {};
int main() {
DummyB b;
printf("This is a dummy\n"); // Set breakpoint here
return 0;
}