36 lines · c
1// XFAIL:*2//// Currently debug info for 'local' behaves, but 'plocal' dereferences to3//// the incorrect value 0xFF after the call to esc.4 5// REQUIRES: lldb6// UNSUPPORTED: system-windows7// RUN: %clang -std=gnu11 -O2 -glldb %s -o %t8// RUN: %dexter --fail-lt 1.0 -w %dexter_lldb_args --binary %t -- %s9//10//// Check that a pointer to a variable living on the stack dereferences to the11//// variable value.12 13int glob;14__attribute__((__noinline__))15void esc(int* p) {16 glob = *p;17 *p = 0xFF;18}19 20int main() {21 int local = 0xA;22 int *plocal = &local;23 esc(plocal); // DexLabel('s1')24 local = 0xB; //// DSE25 return 0; // DexLabel('s2')26}27 28 29// DexExpectWatchValue('local', 0xA, on_line=ref('s1'))30// DexExpectWatchValue('local', 0xB, on_line=ref('s2'))31// DexExpectWatchValue('*plocal', 0xA, on_line=ref('s1'))32// DexExpectWatchValue('*plocal', 0xB, on_line=ref('s2'))33//// Ideally we should be able to observe the dead store to local (0xB) through34//// plocal here.35// DexExpectWatchValue('(local == *plocal)', 'true', from_line=ref('s1'), to_line=ref('s2'))36