29 lines · python
1import lldb2from lldbsuite.test.decorators import *3from lldbsuite.test.lldbtest import *4from lldbsuite.test import lldbutil5 6 7class TestCase(TestBase):8 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")9 def test(self):10 self.build()11 lldbutil.run_to_source_breakpoint(12 self, "// break here", lldb.SBFileSpec("main.cpp")13 )14 15 # Test that global variables contain the right scope operators.16 global_vars = self.frame().GetVariables(False, False, True, False)17 # ManualDWARFIndex using NameToDIE does not sort alphabetically.18 global_var_names = sorted([v.GetName() for v in global_vars])19 expected_var_names = ["::a", "A::a", "B::a", "C::a"]20 self.assertEqual(global_var_names, expected_var_names)21 22 # Test lookup in scopes.23 self.expect_expr("A::a", result_value="1111")24 self.expect_expr("B::a", result_value="2222")25 self.expect_expr("C::a", result_value="3333")26 self.expect_expr("::a", result_value="4444")27 # Check that lookup without scope returns the same result.28 self.expect_expr("a", result_value="4444")29