Files
clang-p2996/lldb/test/Shell/Expr/nodefaultlib.cpp
Michał Górny 15cacab73f [lldb] [test] Skip Expr/nodefaultlib.cpp test if LD_PRELOAD Is used
Some LD_PRELOAD-ed libraries tend to interact badly with --nodefaultlib,
particularly Gentoo sandbox.  Do not run this test if LD_PRELOAD is
present in the running environment.

Differential Revision: https://reviews.llvm.org/D107701
2021-08-09 21:35:11 +02:00

19 lines
573 B
C++

// Test that we're able to evaluate expressions in inferiors without the
// standard library (and mmap-like functions in particular).
// REQUIRES: native
// UNSUPPORTED: ld_preload-present
// XFAIL: system-linux && !(target-x86 || target-x86_64)
// XFAIL: system-netbsd || system-freebsd || system-darwin
// RUN: %build %s --nodefaultlib -o %t
// RUN: %lldb %t -o "b main" -o run -o "p call_me(5, 6)" -o exit \
// RUN: | FileCheck %s
// CHECK: p call_me(5, 6)
// CHECK: (int) $0 = 30
int call_me(int x, long y) { return x * y; }
int main() { return call_me(4, 5); }