Skip to content

Commit 559c6e1

Browse files
committed
Make nrvo-string test more robust.
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
1 parent 7ecf1ec commit 559c6e1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

debuginfo-tests/nrvo-string.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
// RUN: %test_debuginfo %s %t.out
88
//
99
// PR34513
10-
void __attribute__((noinline)) stop() {}
10+
volatile int sideeffect = 0;
11+
void __attribute__((noinline)) stop() { sideeffect++; }
1112

1213
struct string {
1314
string() {}
@@ -18,7 +19,7 @@ struct string {
1819
string get_string() {
1920
string unused;
2021
string result = 3;
21-
// DEBUGGER: break 22
22+
// DEBUGGER: break 23
2223
stop();
2324
return result;
2425
}
@@ -34,7 +35,7 @@ string2 get_string2() {
3435
some_function(result.i);
3536
// Test that the debugger can get the value of result after another
3637
// function is called.
37-
// DEBUGGER: break 38
38+
// DEBUGGER: break 39
3839
stop();
3940
return result;
4041
}

0 commit comments

Comments
 (0)