xref: /llvm-project/lldb/test/API/python_api/get-value-32bit-int/TestGetValue32BitInt.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
1"""
2Check that SBValue.GetValueAsSigned() does the right thing for a 32-bit -1.
3"""
4
5import lldb
6from lldbsuite.test.lldbtest import *
7import lldbsuite.test.lldbutil as lldbutil
8
9
10class TestCase(TestBase):
11    NO_DEBUG_INFO_TESTCASE = True
12
13    def test_with_run_command(self):
14        self.build()
15        lldbutil.run_to_source_breakpoint(
16            self, "// break here", lldb.SBFileSpec("main.cpp")
17        )
18
19        self.assertEqual(self.frame().FindVariable("myvar").GetValueAsSigned(), -1)
20        self.assertEqual(
21            self.frame().FindVariable("myvar").GetValueAsUnsigned(), 0xFFFFFFFF
22        )
23