[Lldb-commits] [lldb] cfb29e4 - [lldb] Fix some tests failing with gmodules after change to stdlib.h

Raphael Isemann via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 17 00:41:02 PST 2020


Author: Raphael Isemann
Date: 2020-02-17T09:39:09+01:00
New Revision: cfb29e4a54b051c888cbff8ed100c7dff5e33d58

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

LOG: [lldb] Fix some tests failing with gmodules after change to stdlib.h

Commit 82b47b2978405f802a33b00d046e6f18ef6a47be changes the way the stdlib.h
header is structured which seems to cause strange lookup failures in the modules
build. This updates a few failing tests so that they pass with the new
behavior of stdlib.h.

See the discussion in https://reviews.llvm.org/rG82b47b2978405f802a33b00d046e6f18ef6a47be

Added: 
    

Modified: 
    lldb/test/API/commands/expression/import-std-module/conflicts/main.cpp
    lldb/test/API/commands/expression/static-initializers/main.cpp
    lldb/test/API/lang/cpp/operators/main.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/test/API/commands/expression/import-std-module/conflicts/main.cpp b/lldb/test/API/commands/expression/import-std-module/conflicts/main.cpp
index e49b862a36c6..ea48c73bc9d5 100644
--- a/lldb/test/API/commands/expression/import-std-module/conflicts/main.cpp
+++ b/lldb/test/API/commands/expression/import-std-module/conflicts/main.cpp
@@ -1,5 +1,6 @@
 #include <cstdlib>
 #include <utility>
+#include <cmath>
 
 int main(int argc, char **argv) {
   std::size_t f = argc;

diff  --git a/lldb/test/API/commands/expression/static-initializers/main.cpp b/lldb/test/API/commands/expression/static-initializers/main.cpp
index 0bcf1eb3edaf..4b0a082d296e 100644
--- a/lldb/test/API/commands/expression/static-initializers/main.cpp
+++ b/lldb/test/API/commands/expression/static-initializers/main.cpp
@@ -4,7 +4,7 @@ int counter = 0;
 
 void inc_counter() { ++counter; }
 
-void do_abort() { abort(); }
+void do_abort() { std::abort(); }
 
 int main() {
   return 0; // break here

diff  --git a/lldb/test/API/lang/cpp/operators/main.cpp b/lldb/test/API/lang/cpp/operators/main.cpp
index 892d0bae42af..ed1161952bf2 100644
--- a/lldb/test/API/lang/cpp/operators/main.cpp
+++ b/lldb/test/API/lang/cpp/operators/main.cpp
@@ -4,8 +4,8 @@ int side_effect = 0;
 
 struct B { int dummy = 2324; };
 struct C {
-  void *operator new(size_t size) { C* r = ::new C; r->custom_new = true; return r; }
-  void *operator new[](size_t size) { C* r = static_cast<C*>(std::malloc(size)); r->custom_new = true; return r; }
+  void *operator new(std::size_t size) { C* r = ::new C; r->custom_new = true; return r; }
+  void *operator new[](std::size_t size) { C* r = static_cast<C*>(std::malloc(size)); r->custom_new = true; return r; }
   void operator delete(void *p) { std::free(p); side_effect = 1; }
   void operator delete[](void *p) { std::free(p); side_effect = 2; }
 


        


More information about the lldb-commits mailing list