[RISCV] Remove old FIXMEs from test. NFC
[llvm-project.git] / cross-project-tests / debuginfo-tests / dexter-tests / nrvo.cpp
blobe9b14da3f5b774d8c2c4fbd3d10ffc6547a4de3f
1 // This ensures that DW_OP_deref is inserted when necessary, such as when NRVO
2 // of a string object occurs in C++.
3 //
4 // REQUIRES: system-windows
5 //
6 // RUN: %clang_cl /Z7 /Zi %s -o %t
7 // RUN: %dexter --fail-lt 1.0 -w --binary %t --debugger 'dbgeng' -- %s
9 struct string {
10 string() {}
11 string(int i) : i(i) {}
12 ~string() {}
13 int i = 0;
15 string get_string() {
16 string unused;
17 string result = 3;
18 return result; // DexLabel('readresult1')
20 void some_function(int) {}
21 struct string2 {
22 string2() = default;
23 string2(string2 &&other) { i = other.i; }
24 int i;
26 string2 get_string2() {
27 string2 result;
28 result.i = 5;
29 some_function(result.i);
30 // Test that the debugger can get the value of result after another
31 // function is called.
32 return result; // DexLabel('readresult2')
34 int main() {
35 get_string();
36 get_string2();
39 // DexExpectWatchValue('result.i', 3, on_line=ref('readresult1'))
40 // DexExpectWatchValue('result.i', 5, on_line=ref('readresult2'))