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
This commit is contained in:
Adrian Prantl 2019-06-26 20:04:09 +00:00
parent 4201ed2ea3
commit 8ac899c600
1 changed files with 5 additions and 2 deletions

View File

@ -7,6 +7,7 @@
// RUN: %test_debuginfo %s %t.out
//
// PR34513
void __attribute__((noinline)) stop() {}
struct string {
string() {}
@ -17,7 +18,8 @@ struct string {
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 @@ string2 get_string2() {
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() {