mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-18 00:16:39 +00:00

This patch makes a further attempt to fix the tests broken by the previous revision by ensuring that the command line for the modified Dexter tests use -std=gnu++11, in keeping with the old build script. This reverts commit 5647f2908de90fe07b0805e988cd2e91a1751928.
44 lines
1.3 KiB
C
44 lines
1.3 KiB
C
// XFAIL: *
|
|
// Incorrect location for variable "parama", see PR48719.
|
|
|
|
// REQUIRES: lldb
|
|
// UNSUPPORTED: system-windows
|
|
// RUN: %clang -std=gnu11 -O3 -glldb %s -o %t
|
|
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
|
|
|
|
// 1. parama is escaped by esc(¶ma) so it is not promoted by
|
|
// SROA/mem2reg.
|
|
// 2. InstCombine's LowerDbgDeclare converts the dbg.declare to a set of
|
|
// dbg.values (tracking the stored SSA values).
|
|
// 3. InstCombine replaces the two stores to parama's alloca (the initial
|
|
// parameter register store in entry and the assignment in if.then) with a
|
|
// PHI+store in the common sucessor.
|
|
// 4. SimplifyCFG folds the blocks together and converts the PHI to a
|
|
// select.
|
|
|
|
// The debug info is not updated to account for the merged value in the
|
|
// sucessor prior to SimplifyCFG when it exists as a PHI, or during when it
|
|
// becomes a select. As a result we see parama=5 for the entire function, when
|
|
// we'd expect to see param=20 when stepping onto fluff().
|
|
|
|
__attribute__((optnone))
|
|
void esc(int* p) {}
|
|
|
|
__attribute__((optnone))
|
|
void fluff() {}
|
|
|
|
__attribute__((noinline))
|
|
int fun(int parama, int paramb) {
|
|
if (parama)
|
|
parama = paramb;
|
|
fluff(); // DexLabel('s0')
|
|
esc(¶ma);
|
|
return 0;
|
|
}
|
|
|
|
int main() {
|
|
return fun(5, 20);
|
|
}
|
|
|
|
// DexExpectWatchValue('parama', 20, on_line=ref('s0'))
|