xref: /llvm-project/lldb/test/API/lang/cpp/bool/TestCPPBool.py (revision 2238dcc39358353cac21df75c3c3286ab20b8f53)
199451b44SJordan Rupprecht"""
299451b44SJordan RupprechtTests that bool types work
399451b44SJordan Rupprecht"""
499451b44SJordan Rupprechtimport lldb
599451b44SJordan Rupprechtfrom lldbsuite.test.lldbtest import *
699451b44SJordan Rupprechtimport lldbsuite.test.lldbutil as lldbutil
799451b44SJordan Rupprecht
899451b44SJordan Rupprecht
999451b44SJordan Rupprechtclass CPPBoolTestCase(TestBase):
1099451b44SJordan Rupprecht    def test_with_run_command(self):
1199451b44SJordan Rupprecht        """Test that bool types work in the expression parser"""
1299451b44SJordan Rupprecht        self.build()
13*2238dcc3SJonas Devlieghere        lldbutil.run_to_source_breakpoint(
14*2238dcc3SJonas Devlieghere            self, "// breakpoint 1", lldb.SBFileSpec("main.cpp")
15*2238dcc3SJonas Devlieghere        )
1699451b44SJordan Rupprecht
17*2238dcc3SJonas Devlieghere        self.expect_expr(
18*2238dcc3SJonas Devlieghere            "bool second_bool = my_bool; second_bool",
19*2238dcc3SJonas Devlieghere            result_type="bool",
20*2238dcc3SJonas Devlieghere            result_value="false",
21*2238dcc3SJonas Devlieghere        )
2299451b44SJordan Rupprecht        self.expect_expr("my_bool = true", result_type="bool", result_value="true")
23