[Object][WebAssembly] Fix data segment offsets higher than 2^31 (#125739)
[llvm-project.git] / lldb / test / API / commands / expression / bitfield_enums / TestBitfieldEnums.py
blob05db4075870b8d3d20f09740e092649b5b1c8dea
1 """
2 Test that the expression parser accounts for the underlying type of bitfield
3 enums when looking for matching values.
4 """
6 import lldb
7 from lldbsuite.test.decorators import *
8 from lldbsuite.test.lldbtest import *
9 from lldbsuite.test import lldbutil
12 class TestBitfieldEnum(TestBase):
13 # Prior to clang-19, clang's DWARF v2 is missing missing DW_AT_type which
14 # causes unsigned_max to appear as -1 instead of the "max" enumerator, whose
15 # value is 3. From 19 onward, DW_AT_type is added as long as strict DWARF
16 # is not enabled.
17 @skipIf(dwarf_version=["<", "3"], compiler="clang", compiler_version=["<", "19.0"])
18 def test_bitfield_enums(self):
19 self.build()
21 lldbutil.run_to_source_breakpoint(
22 self, "// break here", lldb.SBFileSpec("main.cpp", False)
25 self.expect_expr(
26 "bfs",
27 result_type="BitfieldStruct",
28 result_children=[
29 ValueCheck(name="signed_min", value="min"),
30 ValueCheck(name="signed_other", value="-1"),
31 ValueCheck(name="signed_max", value="max"),
32 ValueCheck(name="unsigned_min", value="min"),
33 ValueCheck(name="unsigned_other", value="1"),
34 ValueCheck(name="unsigned_max", value="max"),