diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2018-06-12 00:15:59 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2018-06-12 00:15:59 +0000 |
commit | 9deaf68ed1ff782c91cb08b4dd1bd04c7c02653c (patch) | |
tree | 2332d670f89b74a7d1afcd90ee7e6eb8a21f322a /lldb/packages/Python/lldbsuite/test/lang/cpp/class_static | |
parent | 864ae8be95bfc4dc75d55de41b7e79a9423a9ecc (diff) | |
download | bcm5719-llvm-9deaf68ed1ff782c91cb08b4dd1bd04c7c02653c.tar.gz bcm5719-llvm-9deaf68ed1ff782c91cb08b4dd1bd04c7c02653c.zip |
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
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/cpp/class_static')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py | 42 |
1 files changed, 34 insertions, 8 deletions
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 @@ -44,6 +44,40 @@ class StaticVariableTestCase(TestBase): 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( + 'target variable A::g_points', + VARIABLES_DISPLAYED_CORRECTLY, patterns=[ '\(PointType \[[1-9]*\]\) A::g_points = {', '(x = 1, y = 2)', '(x = 11, y = 22)' @@ -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") |