From e1463ef4d38126a417e7b5662a8c5c8ec3957d73 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Thu, 1 Mar 2018 16:56:28 +0000 Subject: 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. llvm-svn: 326449 --- .../dynamic-value-same-basename/TestDynamicValueSameBase.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test') diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py index 83b20438584..358b3b2d93a 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py @@ -14,7 +14,7 @@ import lldbsuite.test.lldbutil as lldbutil from lldbsuite.test.lldbtest import * -class RenameThisSampleTestTestCase(TestBase): +class DynamicValueSameBaseTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -49,14 +49,18 @@ class RenameThisSampleTestTestCase(TestBase): 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") -- cgit v1.2.3