summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2018-04-20 17:14:05 +0000
committerAdrian Prantl <aprantl@apple.com>2018-04-20 17:14:05 +0000
commit690c828b0b02fde189b40f5dad94fa480c0575a5 (patch)
treec19288dcfdd09f2961f04e167a6db1cee5c57947 /lldb/packages/Python/lldbsuite/test/lang/cpp
parent6c7fe30a1c9012d9881d0fe2faaf6fdfbf956359 (diff)
downloadbcm5719-llvm-690c828b0b02fde189b40f5dad94fa480c0575a5.tar.gz
bcm5719-llvm-690c828b0b02fde189b40f5dad94fa480c0575a5.zip
Fix a crash when resolving overloads of C++ virtual methods.
The isOverload() method needs to account for situations where the two methods being compared don't have the same number of arguments. rdar://problem/39542960 llvm-svn: 330450
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/cpp')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/Makefile5
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/TestVirtualOverload.py3
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/main.cpp17
3 files changed, 25 insertions, 0 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/Makefile b/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/Makefile
new file mode 100644
index 00000000000..314f1cb2f07
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/TestVirtualOverload.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/TestVirtualOverload.py
new file mode 100644
index 00000000000..1311a149326
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/TestVirtualOverload.py
@@ -0,0 +1,3 @@
+from lldbsuite.test import lldbinline
+
+lldbinline.MakeInlineTest(__file__, globals())
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/main.cpp b/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/main.cpp
new file mode 100644
index 00000000000..79c482352f9
--- /dev/null
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/main.cpp
@@ -0,0 +1,17 @@
+// Test that lldb doesn't get confused by an overload of a virtual
+// function of the same name.
+struct Base {
+ virtual void f(int i) {}
+ virtual ~Base() {}
+};
+
+struct Derived : Base {
+ virtual void f(int i, int j) {}
+};
+
+int main(int argc, char **argv) {
+ Derived obj;
+ obj.f(1, 2); //% self.expect("fr var", "not crashing", substrs = ["obj"])
+ return 0;
+}
+
OpenPOWER on IntegriCloud