Make nrvo-string test more robust.
The breakpoint locations were in places where clang doesn't actually
emit a source location for and depend on the debugger's ability to
move the breakpoint forward onto a line that is already in the
function epilogue. In my testing older versions of LLDB fail to do
that, so I'm modifying the test to force a break-able location by
calling a noinline function.
<rdar://problem/52079841>
llvm-svn: 364466
GitOrigin-RevId: 8ac899c6003cba58162161cc07c5c5e2f0da5194
diff --git a/nrvo-string.cpp b/nrvo-string.cpp
index e27d4d3..de89056 100644
--- a/nrvo-string.cpp
+++ b/nrvo-string.cpp
@@ -7,6 +7,7 @@
// RUN: %test_debuginfo %s %t.out
//
// PR34513
+void __attribute__((noinline)) stop() {}
struct string {
string() {}
@@ -17,7 +18,8 @@
string get_string() {
string unused;
string result = 3;
- // DEBUGGER: break 21
+ // DEBUGGER: break 22
+ stop();
return result;
}
void some_function(int) {}
@@ -32,7 +34,8 @@
some_function(result.i);
// Test that the debugger can get the value of result after another
// function is called.
- // DEBUGGER: break 35
+ // DEBUGGER: break 38
+ stop();
return result;
}
int main() {