brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 53a85fe Raw
47 lines · python
1"""2Test DIL arithmetic.3"""4 5import lldb6from lldbsuite.test.lldbtest import *7from lldbsuite.test.decorators import *8from lldbsuite.test import lldbutil9 10 11class TestFrameVarDILArithmetic(TestBase):12    NO_DEBUG_INFO_TESTCASE = True13 14    def test_arithmetic(self):15        self.build()16        lldbutil.run_to_source_breakpoint(17            self, "Set a breakpoint here", lldb.SBFileSpec("main.cpp")18        )19 20        self.runCmd("settings set target.experimental.use-DIL true")21 22        # Check unary results and integral promotion23        self.expect_var_path("+0", value="0")24        self.expect_var_path("-0", value="0")25        self.expect_var_path("+1", value="1")26        self.expect_var_path("-1", value="-1")27        self.expect_var_path("-9223372036854775808", value="9223372036854775808")28        self.expect_var_path("s", value="10", type="short")29        self.expect_var_path("+s", value="10", type="int")30        self.expect_var_path("-s", value="-10", type="int")31        self.expect_var_path("+us", value="1", type="int")32        self.expect_var_path("-us", value="-1", type="int")33        self.expect_var_path("+ref", value="2", type="int")34        self.expect_var_path("-ref", value="-2", type="int")35        self.expect_var_path("+0.0", value="0")36        self.expect_var_path("-0.0", value="-0")37        self.expect_var_path("+enum_one", value="1")38        self.expect_var_path("-enum_one", value="-1")39        self.expect_var_path("+wchar", value="1")40        self.expect_var_path("+char16", value="2")41        self.expect_var_path("+char32", value="3")42        self.expect_var_path("-bitfield.a", value="-1", type="int")43        self.expect_var_path("+bitfield.a", value="1", type="int")44        self.expect_var_path("+bitfield.b", value="2", type="int")45        self.expect_var_path("+bitfield.c", value="3", type="unsigned int")46        self.expect_var_path("+bitfield.d", value="4", type="uint64_t")47