xref: /illumos-gate/usr/src/tools/smatch/src/validation/enum-bitwise.c (revision b30d193948be5a7794d7ae3ba0ed9c2f72c88e0f)
1 #define __bitwise __attribute__((bitwise))
2 #define __force   __attribute__((force))
3 
4 typedef long long __bitwise bits;
5 
6 enum r {
7 	RZ = (__force bits) 0,
8 	RO = (__force bits) 1,
9 	RM = (__force bits) -1,
10 };
11 
12 _Static_assert([typeof(RZ)] == [bits], "RZ");
13 _Static_assert([typeof(RO)] == [bits], "RO");
14 _Static_assert([typeof(RM)] == [bits], "RM");
15 _Static_assert(sizeof(enum r) == sizeof(bits), "bits");
16 
17 /*
18  * check-name: enum-bitwise
19  */
20