Files
clang-p2996/cross-project-tests/debuginfo-tests/dexter-tests/memvars/inlining.c
James Henderson 1364750dad [RFC][debuginfo-test] Rename debug-info lit tests for general purposes
Discussion thread:
https://lists.llvm.org/pipermail/llvm-dev/2021-January/148048.html

Move debuginfo-test into a subdirectory of a new top-level directory,
called cross-project-tests. The new name replaces "debuginfo-test" as an
LLVM project enabled via LLVM_ENABLE_PROJECTS.

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

Reviewed by: aprantl
2021-06-28 11:31:40 +01:00

27 lines
640 B
C

// REQUIRES: lldb
// UNSUPPORTED: system-windows
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb \
// RUN: --builder clang-c --cflags "-O2 -glldb" -- %s
//
//// Check that the once-escaped variable 'param' can still be read after
//// we perform inlining + mem2reg. See D89810 and D85555.
int g;
__attribute__((__always_inline__))
static void use(int* p) {
g = *p;
}
__attribute__((__noinline__))
void fun(int param) {
volatile int step1 = 0; // DexLabel('s1')
use(&param);
volatile int step2 = 0; // DexLabel('s2')
}
int main() {
fun(5);
}
// DexExpectWatchValue('param', '5', from_line=ref('s1'), to_line=ref('s2'))