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/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/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']) +}