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

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 27 13:38:38 PDT 2019


Author: adrian
Date: Thu Jun 27 13:38:37 2019
New Revision: 364589

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

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=364589&r1=364588&r2=364589&view=diff
==============================================================================
--- debuginfo-tests/trunk/nrvo-string.cpp (original)
+++ debuginfo-tests/trunk/nrvo-string.cpp Thu Jun 27 13:38:37 2019
@@ -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() {}
@@ -18,7 +19,7 @@ struct string {
 string get_string() {
   string unused;
   string result = 3;
-  // DEBUGGER: break 22
+  // DEBUGGER: break 23
   stop();
   return result;
 }
@@ -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;
 }




More information about the llvm-commits mailing list