[debuginfo-tests] a874d18 - [DebugInfo] Prevent inlining in NRVO-string test cases

Raphael Isemann via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 01:33:46 PST 2021


Author: Raphael Isemann
Date: 2021-02-11T10:33:30+01:00
New Revision: a874d182c61c7f8e5291c718b40be0e133bf21f0

URL: https://github.com/llvm/llvm-project/commit/a874d182c61c7f8e5291c718b40be0e133bf21f0
DIFF: https://github.com/llvm/llvm-project/commit/a874d182c61c7f8e5291c718b40be0e133bf21f0.diff

LOG: [DebugInfo] Prevent inlining in NRVO-string test cases

Since the new pass manager has been enabled by default these tests had their
-O1 variations failing due to the tested functions being inlined. This just
adds no_inline to the respective code similar to what we did in other
tests (e.g. aa56b30014d96700b2fc945be11866789f341d38 ).

Added: 
    

Modified: 
    debuginfo-tests/dexter-tests/nrvo-string.cpp
    debuginfo-tests/llgdb-tests/nrvo-string.cpp

Removed: 
    


################################################################################
diff  --git a/debuginfo-tests/dexter-tests/nrvo-string.cpp b/debuginfo-tests/dexter-tests/nrvo-string.cpp
index c33b01b13b51..288105eaf65e 100644
--- a/debuginfo-tests/dexter-tests/nrvo-string.cpp
+++ b/debuginfo-tests/dexter-tests/nrvo-string.cpp
@@ -25,7 +25,7 @@ struct string {
   ~string() {}
   int i = 0;
 };
-string get_string() {
+string __attribute__((noinline)) get_string() {
   string unused;
   string output = 3;
   stop(); // DexLabel('string-nrvo')
@@ -37,7 +37,7 @@ struct string2 {
   string2(string2 &&other) { i = other.i; }
   int i;
 };
-string2 get_string2() {
+string2 __attribute__((noinline)) get_string2() {
   string2 output;
   output.i = 5;
   some_function(output.i);

diff  --git a/debuginfo-tests/llgdb-tests/nrvo-string.cpp b/debuginfo-tests/llgdb-tests/nrvo-string.cpp
index ba8d9d42f6f4..9b805c91c4e8 100644
--- a/debuginfo-tests/llgdb-tests/nrvo-string.cpp
+++ b/debuginfo-tests/llgdb-tests/nrvo-string.cpp
@@ -16,7 +16,7 @@ struct string {
   ~string() {}
   int i = 0;
 };
-string get_string() {
+string __attribute__((noinline)) get_string() {
   string unused;
   string result = 3;
   // DEBUGGER: break 23
@@ -29,7 +29,7 @@ struct string2 {
   string2(string2 &&other) { i = other.i; }
   int i;
 };
-string2 get_string2() {
+string2 __attribute__((noinline)) get_string2() {
   string2 result;
   result.i = 5;
   some_function(result.i);


        


More information about the llvm-commits mailing list