xref: /llvm-project/lldb/test/API/python_api/get-value-32bit-int/TestGetValue32BitInt.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
199451b44SJordan Rupprecht"""
299451b44SJordan RupprechtCheck that SBValue.GetValueAsSigned() does the right thing for a 32-bit -1.
399451b44SJordan Rupprecht"""
499451b44SJordan Rupprecht
599451b44SJordan Rupprechtimport lldb
699451b44SJordan Rupprechtfrom lldbsuite.test.lldbtest import *
799451b44SJordan Rupprechtimport lldbsuite.test.lldbutil as lldbutil
899451b44SJordan Rupprecht
9*2238dcc3SJonas Devlieghere
1099451b44SJordan Rupprechtclass TestCase(TestBase):
1199451b44SJordan Rupprecht    NO_DEBUG_INFO_TESTCASE = True
1299451b44SJordan Rupprecht
1399451b44SJordan Rupprecht    def test_with_run_command(self):
1499451b44SJordan Rupprecht        self.build()
15*2238dcc3SJonas Devlieghere        lldbutil.run_to_source_breakpoint(
16*2238dcc3SJonas Devlieghere            self, "// break here", lldb.SBFileSpec("main.cpp")
17*2238dcc3SJonas Devlieghere        )
1899451b44SJordan Rupprecht
1999451b44SJordan Rupprecht        self.assertEqual(self.frame().FindVariable("myvar").GetValueAsSigned(), -1)
20*2238dcc3SJonas Devlieghere        self.assertEqual(
21*2238dcc3SJonas Devlieghere            self.frame().FindVariable("myvar").GetValueAsUnsigned(), 0xFFFFFFFF
22*2238dcc3SJonas Devlieghere        )
23