From 3c160d3051dc5d637bd35cfa673871338589ad8e Mon Sep 17 00:00:00 2001 From: Michael Buch Date: Mon, 13 Feb 2023 12:50:31 +0000 Subject: [PATCH] [lldb][Test][NFC] TestExternalCtorDtorLookup: add more instantiations to test linkage name is correct --- lldb/test/API/lang/cpp/external_ctor_dtor_lookup/Makefile | 2 +- lldb/test/API/lang/cpp/external_ctor_dtor_lookup/lib.cpp | 3 +++ lldb/test/API/lang/cpp/external_ctor_dtor_lookup/lib.h | 5 ++++- lldb/test/API/lang/cpp/external_ctor_dtor_lookup/main.cpp | 6 ++++-- 4 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 lldb/test/API/lang/cpp/external_ctor_dtor_lookup/lib.cpp diff --git a/lldb/test/API/lang/cpp/external_ctor_dtor_lookup/Makefile b/lldb/test/API/lang/cpp/external_ctor_dtor_lookup/Makefile index eba15476332f..3e4cfc7e8256 100644 --- a/lldb/test/API/lang/cpp/external_ctor_dtor_lookup/Makefile +++ b/lldb/test/API/lang/cpp/external_ctor_dtor_lookup/Makefile @@ -1,3 +1,3 @@ -CXX_SOURCES := main.cpp +CXX_SOURCES := main.cpp lib.cpp include Makefile.rules diff --git a/lldb/test/API/lang/cpp/external_ctor_dtor_lookup/lib.cpp b/lldb/test/API/lang/cpp/external_ctor_dtor_lookup/lib.cpp new file mode 100644 index 000000000000..f1724b73bdce --- /dev/null +++ b/lldb/test/API/lang/cpp/external_ctor_dtor_lookup/lib.cpp @@ -0,0 +1,3 @@ +#include "lib.h" + +Wrapper getFooWrapper() { return {}; } diff --git a/lldb/test/API/lang/cpp/external_ctor_dtor_lookup/lib.h b/lldb/test/API/lang/cpp/external_ctor_dtor_lookup/lib.h index 9664068b6e14..1fee83fb115a 100644 --- a/lldb/test/API/lang/cpp/external_ctor_dtor_lookup/lib.h +++ b/lldb/test/API/lang/cpp/external_ctor_dtor_lookup/lib.h @@ -8,5 +8,8 @@ public: [[gnu::abi_tag("test")]] ~Wrapper(){}; }; -#endif // _H_IN +struct Foo {}; + +Wrapper getFooWrapper(); +#endif // _H_IN diff --git a/lldb/test/API/lang/cpp/external_ctor_dtor_lookup/main.cpp b/lldb/test/API/lang/cpp/external_ctor_dtor_lookup/main.cpp index 3904646c05db..e1caf0202d97 100644 --- a/lldb/test/API/lang/cpp/external_ctor_dtor_lookup/main.cpp +++ b/lldb/test/API/lang/cpp/external_ctor_dtor_lookup/main.cpp @@ -1,7 +1,5 @@ #include "lib.h" -struct Foo {}; - struct Bar { Wrapper getWrapper() { return Wrapper(); } int sinkWrapper(Wrapper) { return -1; } @@ -9,6 +7,10 @@ struct Bar { int main() { Bar b; + Wrapper w1; + Wrapper w2; + Wrapper w3 = getFooWrapper(); + Wrapper w4; return b.sinkWrapper(b.getWrapper()); } -- 2.34.1