From 9deaf68ed1ff782c91cb08b4dd1bd04c7c02653c Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Tue, 12 Jun 2018 00:15:59 +0000 Subject: Exempt some compilers from new static variable test. Apparently some compilers generate incomplete debug information which caused the updated test to fail. Therefore I've extracted the new check into a separate test case with the necessary decorators. llvm-svn: 334456 --- .../lang/cpp/class_static/TestStaticVariables.py | 42 +++++++++++++++++----- 1 file changed, 34 insertions(+), 8 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/lang/cpp/class_static') diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py index ee4bb3d43b7..97b0bfd8aee 100644 --- a/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py +++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py @@ -39,6 +39,40 @@ class StaticVariableTestCase(TestBase): substrs=['stopped', 'stop reason = breakpoint']) + # Global variables are no longer displayed with the "frame variable" + # command. + self.expect( + 'target variable A::g_points', + VARIABLES_DISPLAYED_CORRECTLY, + patterns=['\(PointType \[[1-9]*\]\) A::g_points = {']) + self.expect('target variable g_points', VARIABLES_DISPLAYED_CORRECTLY, + substrs=['(PointType [2]) g_points']) + + # On Mac OS X, gcc 4.2 emits the wrong debug info for A::g_points. + # A::g_points is an array of two elements. + if self.platformIsDarwin() or self.getPlatform() == "linux": + self.expect( + "target variable A::g_points[1].x", + VARIABLES_DISPLAYED_CORRECTLY, + startstr="(int) A::g_points[1].x = 11") + + @expectedFailureAll( + compiler=["gcc"], + bugnumber="Compiler emits incomplete debug info") + @expectedFailureAll( + compiler=["clang"], + compiler_version=["<", "3.9"], + bugnumber='llvm.org/pr20550') + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764") + def test_with_run_command_complete(self): + """ + Test that file and class static variables display correctly with + complete debug information. + """ + self.build() + target = self.dbg.CreateTarget(self.getBuildArtifact("a.out")) + self.assertTrue(target, VALID_TARGET) + # Global variables are no longer displayed with the "frame variable" # command. self.expect( @@ -67,14 +101,6 @@ class StaticVariableTestCase(TestBase): '(x = 11, y = 22)', '(x = 3, y = 4)', '(x = 33, y = 44)' ]) - # On Mac OS X, gcc 4.2 emits the wrong debug info for A::g_points. - # A::g_points is an array of two elements. - if self.platformIsDarwin() or self.getPlatform() == "linux": - self.expect( - "target variable A::g_points[1].x", - VARIABLES_DISPLAYED_CORRECTLY, - startstr="(int) A::g_points[1].x = 11") - @expectedFailureAll( compiler=["gcc"], bugnumber="Compiler emits incomplete debug info") -- cgit v1.2.3