diff options
Diffstat (limited to 'gdb/testsuite/gdb.base/printcmds.c')
-rw-r--r-- | gdb/testsuite/gdb.base/printcmds.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.base/printcmds.c b/gdb/testsuite/gdb.base/printcmds.c index 57e04e6..acb3cb3 100644 --- a/gdb/testsuite/gdb.base/printcmds.c +++ b/gdb/testsuite/gdb.base/printcmds.c @@ -96,9 +96,35 @@ enum some_volatile_enum { enumvolval1, enumvolval2 }; name. See PR11827. */ volatile enum some_volatile_enum some_volatile_enum = enumvolval1; -enum flag_enum { ONE = 1, TWO = 2 }; +/* An enum considered as a "flag enum". */ +enum flag_enum +{ + FE_NONE = 0x00, + FE_ONE = 0x01, + FE_TWO = 0x02, +}; + +enum flag_enum three = FE_ONE | FE_TWO; + +/* Another enum considered as a "flag enum", but with no enumerator with value + 0. */ +enum flag_enum_without_zero +{ + FEWZ_ONE = 0x01, + FEWZ_TWO = 0x02, +}; + +enum flag_enum_without_zero flag_enum_without_zero = 0; + +/* Not a flag enum, an enumerator value has multiple bits sets. */ +enum not_flag_enum +{ + NFE_ONE = 0x01, + NFE_TWO = 0x02, + NFE_F0 = 0xf0, +}; -enum flag_enum three = ONE | TWO; +enum not_flag_enum three_not_flag = NFE_ONE | NFE_TWO; /* A structure with an embedded array at an offset > 0. The array has all elements with the same repeating value, which must not be the |