[Lldb-commits] [lldb] 3c160d3 - [lldb][Test][NFC] TestExternalCtorDtorLookup: add more instantiations to test linkage name is correct

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 13 04:51:30 PST 2023


Author: Michael Buch
Date: 2023-02-13T12:51:05Z
New Revision: 3c160d3051dc5d637bd35cfa673871338589ad8e

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

LOG: [lldb][Test][NFC] TestExternalCtorDtorLookup: add more instantiations to test linkage name is correct

Added: 
    lldb/test/API/lang/cpp/external_ctor_dtor_lookup/lib.cpp

Modified: 
    lldb/test/API/lang/cpp/external_ctor_dtor_lookup/Makefile
    lldb/test/API/lang/cpp/external_ctor_dtor_lookup/lib.h
    lldb/test/API/lang/cpp/external_ctor_dtor_lookup/main.cpp

Removed: 
    


################################################################################
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 eba15476332f9..3e4cfc7e82568 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 0000000000000..f1724b73bdce6
--- /dev/null
+++ b/lldb/test/API/lang/cpp/external_ctor_dtor_lookup/lib.cpp
@@ -0,0 +1,3 @@
+#include "lib.h"
+
+Wrapper<Foo> 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 9664068b6e141..1fee83fb115aa 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 @@ template <typename T> class Wrapper {
   [[gnu::abi_tag("test")]] ~Wrapper(){};
 };
 
-#endif // _H_IN
+struct Foo {};
+
+Wrapper<Foo> 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 3904646c05db3..e1caf0202d97d 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<Foo> getWrapper() { return Wrapper<Foo>(); }
   int sinkWrapper(Wrapper<Foo>) { return -1; }
@@ -9,6 +7,10 @@ struct Bar {
 
 int main() {
   Bar b;
+  Wrapper<int> w1;
+  Wrapper<double> w2;
+  Wrapper<Foo> w3 = getFooWrapper();
+  Wrapper<Foo> w4;
   return b.sinkWrapper(b.getWrapper());
 }
 


        


More information about the lldb-commits mailing list