[Lldb-commits] [lldb] r326449 - Make TestDynamicValueSameBase gcc-compatible

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 1 08:56:28 PST 2018


Author: labath
Date: Thu Mar  1 08:56:28 2018
New Revision: 326449

URL: http://llvm.org/viewvc/llvm-project?rev=326449&view=rev
Log:
Make TestDynamicValueSameBase gcc-compatible

gcc will say that the type of "this" is "T * const", clang "T *".
Compare the unqualified type names to erase the difference between the
two, as the constness is not a part of this test.

FWIW, I think that the gcc behavior makes more sense here.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py?rev=326449&r1=326448&r2=326449&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py Thu Mar  1 08:56:28 2018
@@ -14,7 +14,7 @@ import lldbsuite.test.lldbutil as lldbut
 from lldbsuite.test.lldbtest import *
 
 
-class RenameThisSampleTestTestCase(TestBase):
+class DynamicValueSameBaseTestCase(TestBase):
 
     mydir = TestBase.compute_mydir(__file__)
 
@@ -49,14 +49,18 @@ class RenameThisSampleTestTestCase(TestB
 
         frame = threads[0].frame[0]
         namesp_this = frame.FindVariable("this", lldb.eDynamicCanRunTarget)
-        self.assertEqual(namesp_this.GetTypeName(), "namesp::Virtual *", "Didn't get the right dynamic type")
+        # Clang specifies the type of this as "T *", gcc as "T * const". This
+        # erases the difference.
+        namesp_type = namesp_this.GetType().GetUnqualifiedType()
+        self.assertEqual(namesp_type.GetName(), "namesp::Virtual *", "Didn't get the right dynamic type")
 
         threads = lldbutil.continue_to_breakpoint(process, virtual_bkpt)
         self.assertEqual(len(threads), 1, "Didn't stop at virtual breakpoint")
 
         frame = threads[0].frame[0]
         virtual_this = frame.FindVariable("this", lldb.eDynamicCanRunTarget)
-        self.assertEqual(virtual_this.GetTypeName(), "Virtual *", "Didn't get the right dynamic type")
+        virtual_type = virtual_this.GetType().GetUnqualifiedType()
+        self.assertEqual(virtual_type.GetName(), "Virtual *", "Didn't get the right dynamic type")
 
         
 




More information about the lldb-commits mailing list