blob: 18acebb0e6dd22157efce6f97a37d7c66386ab8a [file] [log] [blame]
Reid Kleckner496ecab2017-09-15 21:59:39 +00001// This ensures that DW_OP_deref is inserted when necessary, such as when NRVO
2// of a string object occurs in C++.
3//
Adrian Prantla0de3a82017-12-07 19:40:31 +00004// RUN: %clangxx -O0 -fno-exceptions %target_itanium_abi_host_triple %s -o %t.out -g
Reid Kleckner496ecab2017-09-15 21:59:39 +00005// RUN: %test_debuginfo %s %t.out
Adrian Prantla0de3a82017-12-07 19:40:31 +00006// RUN: %clangxx -O1 -fno-exceptions %target_itanium_abi_host_triple %s -o %t.out -g
Mike Edwards4a343382017-09-19 14:51:37 +00007// RUN: %test_debuginfo %s %t.out
Reid Kleckner496ecab2017-09-15 21:59:39 +00008//
9// PR34513
10
11struct string {
12 string() {}
13 string(int i) : i(i) {}
14 ~string() {}
15 int i = 0;
16};
17string get_string() {
18 string unused;
19 string result = 3;
20// DEBUGGER: break 21
21 return result;
22}
23int main() { get_string(); }
24
25// DEBUGGER: r
26// DEBUGGER: print result.i
27// CHECK: = 3