2 Test that the expression parser accounts for the underlying type of bitfield
3 enums when looking for matching values.
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
17 @skipIf(dwarf_version
=["<", "3"], compiler
="clang", compiler_version
=["<", "19.0"])
18 def test_bitfield_enums(self
):
21 lldbutil
.run_to_source_breakpoint(
22 self
, "// break here", lldb
.SBFileSpec("main.cpp", False)
27 result_type
="BitfieldStruct",
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"),