46 lines · c
1// XFAIL:*2//// We don't yet support DW_OP_implicit_pointer in llvm.3 4// REQUIRES: lldb5// UNSUPPORTED: system-windows6// RUN: %clang -std=gnu11 -O3 -glldb %s -o %t7// RUN: %dexter --fail-lt 1.0 -w %dexter_lldb_args --binary %t -- %s8 9//// Check that 'param' in 'fun' can be read throughout, and that 'pa' and 'pb'10//// can be dereferenced in the debugger even if we can't provide the pointer11//// value itself.12 13int globa;14int globb;15 16//// A no-inline, read-only function with internal linkage is a good candidate17//// for arg promotion.18__attribute__((__noinline__))19static void use_promote(const int* pa) {20 //// Promoted args would be a good candidate for an DW_OP_implicit_pointer.21 globa = *pa; // DexLabel('s2')22}23 24__attribute__((__always_inline__))25static void use_inline(const int* pb) {26 //// Inlined pointer to callee local would be a good candidate for an27 //// DW_OP_implicit_pointer.28 globb = *pb; // DexLabel('s3')29}30 31__attribute__((__noinline__))32int fun(int param) {33 volatile int step = 0; // DexLabel('s1')34 use_promote(¶m);35 use_inline(¶m);36 return step; // DexLabel('s4')37}38 39int main() {40 return fun(5);41}42 43// DexExpectWatchValue('param', 5, from_line=ref('s1'), to_line=ref('s4'))44// DexExpectWatchValue('*pa', 5, on_line=ref('s2'))45// DexExpectWatchValue('*pb', 5, on_line=ref('s3'))46