[Lldb-commits] [lldb] r269698 - Test diamond virtual inheritance in top-level expressions.

Sean Callanan via lldb-commits lldb-commits at lists.llvm.org
Mon May 16 13:55:10 PDT 2016


Author: spyffe
Date: Mon May 16 15:55:10 2016
New Revision: 269698

URL: http://llvm.org/viewvc/llvm-project?rev=269698&view=rev
Log:
Test diamond virtual inheritance in top-level expressions.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/expression_command/top-level/test.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/expression_command/top-level/test.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/top-level/test.cpp?rev=269698&r1=269697&r2=269698&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/expression_command/top-level/test.cpp (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/top-level/test.cpp Mon May 16 15:55:10 2016
@@ -55,9 +55,53 @@ public:
 
 // --
 
+class DiamondA
+{
+private:
+  struct {
+    int m_i;
+  };
+public:
+  DiamondA(int i) : m_i(i) { }
+  int accessor() { return m_i; }
+};
+
+// --
+
+class DiamondB : public virtual DiamondA
+{
+public:
+  DiamondB(int i) : DiamondA(i) { }
+};
+
+// --
+
+class DiamondC : public virtual DiamondA
+{
+public:
+  DiamondC(int i) : DiamondA(i) { }
+};
+
+// --
+
+class DiamondD : public DiamondB, public DiamondC
+{
+public:
+  DiamondD(int i) : DiamondA(i), DiamondB(i), DiamondC(i) { }
+};
+
+// --
+
 int doTest()
 {
-    return m.memberResult() + MyClass::staticResult() + m.externResult() + MyEnum::myEnumThree + myEnumOne + AnotherClass().complicatedFunction();
+    int a = m.memberResult();
+    a += MyClass::staticResult();
+    a += m.externResult();
+    a += MyEnum::myEnumThree;
+    a += myEnumOne;
+    a += AnotherClass().complicatedFunction();
+    a += DiamondD(3).accessor();
+    return a;
 }
 
 // --




More information about the lldb-commits mailing list