1#include <stdint.h>
2
3enum class EnumVals : uint16_t { VAL0 = 0 };
4
5struct Foo {
6 EnumVals b : 4;
7};
8
9int main(int argc, char const *argv[], char const *envp[]) {
10 Foo f{.b = static_cast<EnumVals>(8)};
11 return 0; //% b = self.frame().FindVariable("f").GetChildMemberWithName("b")
12 //% val = b.GetValueAsUnsigned()
13 //% self.assertEqual(val, 8, "Bit-field not correctly extracted")
14}
15

source code of lldb/test/API/python_api/sbvalue_unsigned_enum_bitfield_value/main.cpp