xref: /illumos-gate/usr/src/tools/smatch/src/validation/bug-rshift-ub.c (revision 689b9301078f0c35c7f198fcee8032a0d30eff3a)
1 enum a {
2 	A = ~0ULL,
3 };
4 
5 static enum a a = A;
6 
7 /*
8  * check-name: bug-rshift-ub
9  * check-description:
10  *	This test trigger(ed) a bug on x86 caused by a
11  *	full width shift (which is UB), expecting to get
12  *	0 but giving the unshifted value and as result
13  *	the type is invalid:
14  *		warning: incorrect type in initializer (invalid types)
15  *			 expected bad type enum a static [toplevel] a
16  */
17