Reid Kleckner | 496ecab | 2017-09-15 21:59:39 +0000 | [diff] [blame] | 1 | // This ensures that DW_OP_deref is inserted when necessary, such as when NRVO |
| 2 | // of a string object occurs in C++. |
| 3 | // |
Adrian Prantl | a0de3a8 | 2017-12-07 19:40:31 +0000 | [diff] [blame^] | 4 | // RUN: %clangxx -O0 -fno-exceptions %target_itanium_abi_host_triple %s -o %t.out -g |
Reid Kleckner | 496ecab | 2017-09-15 21:59:39 +0000 | [diff] [blame] | 5 | // RUN: %test_debuginfo %s %t.out |
Adrian Prantl | a0de3a8 | 2017-12-07 19:40:31 +0000 | [diff] [blame^] | 6 | // RUN: %clangxx -O1 -fno-exceptions %target_itanium_abi_host_triple %s -o %t.out -g |
Mike Edwards | 4a34338 | 2017-09-19 14:51:37 +0000 | [diff] [blame] | 7 | // RUN: %test_debuginfo %s %t.out |
Reid Kleckner | 496ecab | 2017-09-15 21:59:39 +0000 | [diff] [blame] | 8 | // |
| 9 | // PR34513 |
| 10 | |
| 11 | struct string { |
| 12 | string() {} |
| 13 | string(int i) : i(i) {} |
| 14 | ~string() {} |
| 15 | int i = 0; |
| 16 | }; |
| 17 | string get_string() { |
| 18 | string unused; |
| 19 | string result = 3; |
| 20 | // DEBUGGER: break 21 |
| 21 | return result; |
| 22 | } |
| 23 | int main() { get_string(); } |
| 24 | |
| 25 | // DEBUGGER: r |
| 26 | // DEBUGGER: print result.i |
| 27 | // CHECK: = 3 |