aboutsummaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/main.cpp')
-rw-r--r--packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/main.cpp69
1 files changed, 69 insertions, 0 deletions
diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/main.cpp b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/main.cpp
new file mode 100644
index 000000000000..78cac2c89653
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/main.cpp
@@ -0,0 +1,69 @@
+#include <stdio.h>
+#include <stdint.h>
+
+class A
+{
+public:
+ A(int a) :
+ m_a(a)
+ {
+ }
+ virtual ~A(){}
+ virtual int get2() const { return m_a; }
+ virtual int get() const { return m_a; }
+protected:
+ int m_a;
+};
+
+class B : public A
+{
+public:
+ B(int a, int b) :
+ A(a),
+ m_b(b)
+ {
+ }
+
+ ~B() override
+ {
+ }
+
+ int get2() const override
+ {
+ return m_b;
+ }
+ int get() const override
+ {
+ return m_b;
+ }
+
+protected:
+ int m_b;
+};
+
+struct C
+{
+ C(int c) : m_c(c){}
+ virtual ~C(){}
+ int m_c;
+};
+
+class D : public C, public B
+{
+public:
+ D(int a, int b, int c, int d) :
+ C(c),
+ B(a, b),
+ m_d(d)
+ {
+ }
+protected:
+ int m_d;
+};
+int main (int argc, char const *argv[], char const *envp[])
+{
+ D *good_d = new D(1, 2, 3, 4);
+ D *d = nullptr;
+ return d->get();
+}
+