Skip to content

Commit

Permalink
Make nrvo-string test more robust.
Browse files Browse the repository at this point in the history
This is a follow-up to r364466, but better implemented. Original
commit message still applies:

    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: 364589
  • Loading branch information
adrian-prantl committed Jun 27, 2019
1 parent 7ecf1ec commit 559c6e1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions debuginfo-tests/nrvo-string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
// RUN: %test_debuginfo %s %t.out
//
// PR34513
void __attribute__((noinline)) stop() {}
volatile int sideeffect = 0;
void __attribute__((noinline)) stop() { sideeffect++; }

struct string {
string() {}
Expand All @@ -18,7 +19,7 @@ struct string {
string get_string() {
string unused;
string result = 3;
// DEBUGGER: break 22
// DEBUGGER: break 23
stop();
return result;
}
Expand All @@ -34,7 +35,7 @@ string2 get_string2() {
some_function(result.i);
// Test that the debugger can get the value of result after another
// function is called.
// DEBUGGER: break 38
// DEBUGGER: break 39
stop();
return result;
}
Expand Down

0 comments on commit 559c6e1

Please sign in to comment.