1 // This ensures that DW_OP_deref is inserted when necessary, such as when NRVO
2 // of a string object occurs in C++.
4 // RUN: %clangxx -O0 -fno-exceptions %target_itanium_abi_host_triple %s -o %t.out -g
5 // RUN: %test_debuginfo %s %t.out
6 // RUN: %clangxx -O1 -fno-exceptions %target_itanium_abi_host_triple %s -o %t.out -g
7 // RUN: %test_debuginfo %s %t.out
8 // XFAIL: !system-darwin && gdb-clang-incompatibility
10 volatile int sideeffect
= 0;
11 void __attribute__((noinline
)) stop() { sideeffect
++; }
15 string(int i
) : i(i
) {}
19 string
__attribute__((noinline
)) get_string() {
26 void some_function(int) {}
29 string2(string2
&&other
) { i
= other
.i
; }
32 string2
__attribute__((noinline
)) get_string2() {
35 some_function(result
.i
);
36 // Test that the debugger can get the value of result after another
37 // function is called.
48 // DEBUGGER: print result.i
51 // DEBUGGER: print result.i