teemperor created this revision.
teemperor added a reviewer: lhames.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
rdar://38048657 says that the following test case was broken. It seems to have
been fixed since then, so
this patch just adds the test case to our test suite to check for regressions.
Repository:
rLLDB LLDB
https://reviews.llvm.org/D65872
Files:
lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-ptr-vs-ref/Makefile
lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-ptr-vs-ref/TestVirtualPtrVsRef.py
lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-ptr-vs-ref/main.cpp
Index: lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-ptr-vs-ref/main.cpp
===================================================================
--- /dev/null
+++ lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-ptr-vs-ref/main.cpp
@@ -0,0 +1,19 @@
+class A {
+public:
+ virtual ~A() {}
+ virtual int Dump() { return 1; }
+};
+
+class B : public A {
+public:
+ virtual ~B() {}
+ virtual int Dump() { return 2; }
+};
+
+int main(int argc, char const *argv[], char const *envp[]) {
+ B ref;
+ A *ptr = &ref;
+ ptr->Dump();
+ return 0; //%self.expect("p ref.Dump()", substrs=['(int)', ' = 2'])
+ //%self.expect("p ptr->Dump()", substrs=['(int)', ' = 2'])
+}
Index:
lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-ptr-vs-ref/TestVirtualPtrVsRef.py
===================================================================
--- /dev/null
+++
lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-ptr-vs-ref/TestVirtualPtrVsRef.py
@@ -0,0 +1,4 @@
+from lldbsuite.test import lldbinline
+from lldbsuite.test import decorators
+
+lldbinline.MakeInlineTest(__file__, globals())
Index: lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-ptr-vs-ref/Makefile
===================================================================
--- /dev/null
+++ lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-ptr-vs-ref/Makefile
@@ -0,0 +1,3 @@
+LEVEL = ../../../make
+CXX_SOURCES := main.cpp
+include $(LEVEL)/Makefile.rules
Index: lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-ptr-vs-ref/main.cpp
===================================================================
--- /dev/null
+++ lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-ptr-vs-ref/main.cpp
@@ -0,0 +1,19 @@
+class A {
+public:
+ virtual ~A() {}
+ virtual int Dump() { return 1; }
+};
+
+class B : public A {
+public:
+ virtual ~B() {}
+ virtual int Dump() { return 2; }
+};
+
+int main(int argc, char const *argv[], char const *envp[]) {
+ B ref;
+ A *ptr = &ref;
+ ptr->Dump();
+ return 0; //%self.expect("p ref.Dump()", substrs=['(int)', ' = 2'])
+ //%self.expect("p ptr->Dump()", substrs=['(int)', ' = 2'])
+}
Index: lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-ptr-vs-ref/TestVirtualPtrVsRef.py
===================================================================
--- /dev/null
+++ lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-ptr-vs-ref/TestVirtualPtrVsRef.py
@@ -0,0 +1,4 @@
+from lldbsuite.test import lldbinline
+from lldbsuite.test import decorators
+
+lldbinline.MakeInlineTest(__file__, globals())
Index: lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-ptr-vs-ref/Makefile
===================================================================
--- /dev/null
+++ lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-ptr-vs-ref/Makefile
@@ -0,0 +1,3 @@
+LEVEL = ../../../make
+CXX_SOURCES := main.cpp
+include $(LEVEL)/Makefile.rules
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits