[debuginfo-tests] r364466 - Make nrvo-string test more robust.

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 26 13:04:09 PDT 2019


Author: adrian
Date: Wed Jun 26 13:04:09 2019
New Revision: 364466

URL: http://llvm.org/viewvc/llvm-project?rev=364466&view=rev
Log:
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>

Modified:
    debuginfo-tests/trunk/nrvo-string.cpp

Modified: debuginfo-tests/trunk/nrvo-string.cpp
URL: http://llvm.org/viewvc/llvm-project/debuginfo-tests/trunk/nrvo-string.cpp?rev=364466&r1=364465&r2=364466&view=diff
==============================================================================
--- debuginfo-tests/trunk/nrvo-string.cpp (original)
+++ debuginfo-tests/trunk/nrvo-string.cpp Wed Jun 26 13:04:09 2019
@@ -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() {




More information about the llvm-commits mailing list