From cfb29e4a54b051c888cbff8ed100c7dff5e33d58 Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Mon, 17 Feb 2020 09:39:06 +0100 Subject: [PATCH] [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 --- .../commands/expression/import-std-module/conflicts/main.cpp | 1 + .../test/API/commands/expression/static-initializers/main.cpp | 2 +- lldb/test/API/lang/cpp/operators/main.cpp | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) 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 #include +#include 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(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(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; }