diff options
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
4 files changed, 19 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/commands/expression/call-overridden-method/TestCallOverriddenMethod.py b/lldb/packages/Python/lldbsuite/test/commands/expression/call-overridden-method/TestCallOverriddenMethod.py index c22fffb4f23..93b91854281 100644 --- a/lldb/packages/Python/lldbsuite/test/commands/expression/call-overridden-method/TestCallOverriddenMethod.py +++ b/lldb/packages/Python/lldbsuite/test/commands/expression/call-overridden-method/TestCallOverriddenMethod.py @@ -49,3 +49,7 @@ class ExprCommandCallOverriddenMethod(TestBase): # Test calling the base class. self.expect("expr realbase.foo()", substrs=["1"]) + + # Test with locally constructed instances. + self.expect("expr Base().foo()", substrs=["1"]) + self.expect("expr Derived().foo()", substrs=["2"]) diff --git a/lldb/packages/Python/lldbsuite/test/commands/expression/call-overridden-method/main.cpp b/lldb/packages/Python/lldbsuite/test/commands/expression/call-overridden-method/main.cpp index 712c374eefd..87997fa354c 100644 --- a/lldb/packages/Python/lldbsuite/test/commands/expression/call-overridden-method/main.cpp +++ b/lldb/packages/Python/lldbsuite/test/commands/expression/call-overridden-method/main.cpp @@ -11,6 +11,7 @@ public: int main() { Base realbase; + realbase.foo(); Derived d; Base *b = &d; return 0; // Set breakpoint here diff --git a/lldb/packages/Python/lldbsuite/test/commands/expression/ignore-artificial-constructors/TestIgnoreArtificialConstructors.py b/lldb/packages/Python/lldbsuite/test/commands/expression/ignore-artificial-constructors/TestIgnoreArtificialConstructors.py new file mode 100644 index 00000000000..03424658f3e --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/commands/expression/ignore-artificial-constructors/TestIgnoreArtificialConstructors.py @@ -0,0 +1,4 @@ +from lldbsuite.test import lldbinline +from lldbsuite.test import decorators + +lldbinline.MakeInlineTest(__file__, globals(), None) diff --git a/lldb/packages/Python/lldbsuite/test/commands/expression/ignore-artificial-constructors/main.cpp b/lldb/packages/Python/lldbsuite/test/commands/expression/ignore-artificial-constructors/main.cpp new file mode 100644 index 00000000000..41457ebe1da --- /dev/null +++ b/lldb/packages/Python/lldbsuite/test/commands/expression/ignore-artificial-constructors/main.cpp @@ -0,0 +1,10 @@ +struct Foo { + // Triggers that we emit an artificial constructor for Foo. + virtual ~Foo() = default; +}; + +int main() { + Foo f; + // Try to construct foo in our expression. + return 0; //%self.expect("expr Foo()", substrs=["(Foo) $0 = {}"]) +} |