Revert "[Dexter] Remove builder from Dexter"
[llvm-project.git] / cross-project-tests / debuginfo-tests / dexter-tests / memvars / implicit-ptr.c
blob7b59afb0d13182d1c9bb0cb7f584d2f4364e30fe
1 // XFAIL:*
2 //// We don't yet support DW_OP_implicit_pointer in llvm.
4 // REQUIRES: lldb
5 // UNSUPPORTED: system-windows
6 // RUN: %dexter --fail-lt 1.0 -w --debugger lldb \
7 // RUN: --builder 'clang-c' --cflags "-O3 -glldb" -- %s
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 pointer
11 //// value itself.
13 int globa;
14 int globb;
16 //// A no-inline, read-only function with internal linkage is a good candidate
17 //// for arg promotion.
18 __attribute__((__noinline__))
19 static 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')
24 __attribute__((__always_inline__))
25 static void use_inline(const int* pb) {
26 //// Inlined pointer to callee local would be a good candidate for an
27 //// DW_OP_implicit_pointer.
28 globb = *pb; // DexLabel('s3')
31 __attribute__((__noinline__))
32 int fun(int param) {
33 volatile int step = 0; // DexLabel('s1')
34 use_promote(&param);
35 use_inline(&param);
36 return step; // DexLabel('s4')
39 int main() {
40 return fun(5);
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'))