1 // XFAIL: !system-darwin || !target-aarch64
2 //// Suboptimal coverage, see inlined comments.
5 // UNSUPPORTED: system-windows
6 // RUN: %clang -std=gnu11 -O3 -glldb %s -o %t
7 // RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
9 //// Adapted from https://bugs.llvm.org/show_bug.cgi?id=34136#c4
13 __attribute__((__noinline__
))
19 __attribute__((__noinline__
))
24 __attribute__((__noinline__
))
26 esc(¶m
); //// alloca is live until here DexLabel('s1')
27 if (param
== 0) { //// end of alloca live range
28 //// param is now a constant, but without lowering to dbg.value we can't
29 //// capture that and would still point to the stack slot that may even have
30 //// been reused by now.
32 //// Right now we get suboptimal coverage for x86: the param load below is
33 //// CSE'd with the if condition.
34 //// Instcombine runs LowerDbgDeclare and inserts a dbg.value after the load.
35 //// SelectionDAG combines the load and cmp. We go from this IR:
36 //// %0 = load i32, i32* %param.addr, align 4, !dbg !42, !tbaa !20
37 //// call void @llvm.dbg.value(metadata i32 %0, ...
38 //// %cmp = icmp eq i32 %0, 0, !dbg !44
40 //// DBG_VALUE $noreg, $noreg, !"param"...
41 //// CMP32mi8 %param.addr, 1, $noreg, 0, $noreg, 0, implicit-def $eflags, debug-location !44
44 return 0; // DexLabel('s2')
51 // DexExpectWatchValue('param', '5', from_line=ref('s1'), to_line=ref('s2'))