tests: make tests.elf.SHF an IntFlag

Upcoming tests will need to combine flags.

Fixes: 104a14781d ("tests: test compressed debug sections")
Signed-off-by: Omar Sandoval <osandov@osandov.com>
This commit is contained in:
Omar Sandoval 2023-10-11 14:29:31 -07:00
parent 64de9ef829
commit 882d73a523
2 changed files with 3 additions and 2 deletions

View File

@ -58,7 +58,8 @@ from typing import Text
)
for type_name, constants in enums.items():
assert constants
f.write(f"\n\nclass {type_name}(enum.IntEnum):\n")
enum_class = "IntFlag" if type_name == "SHF" else "IntEnum"
f.write(f"\n\nclass {type_name}(enum.{enum_class}):\n")
for name, value in constants:
f.write(f" {name} = 0x{value:X}\n")
f.write(

View File

@ -63,7 +63,7 @@ class PT(enum.IntEnum):
return hex(value)
class SHF(enum.IntEnum):
class SHF(enum.IntFlag):
WRITE = 0x1
ALLOC = 0x2
EXECINSTR = 0x4