db/fixup_kernel.sh: fix clear_user() handling
[smatch.git] / validation / enum-bounds.c
blob49f7a1ed81d830722c4ccd545e90733eba5c72d9
1 enum bound_int_max {
2 IMAX = __INT_MAX__,
3 };
4 _Static_assert([typeof(IMAX)] == [int], "");
6 enum bound_int_maxp1 {
7 IMP1 = __INT_MAX__ + 1L,
8 };
9 _Static_assert([typeof(IMP1)] == [unsigned int], "");
11 enum bound_int_maxm1 {
12 IMM1 = -__INT_MAX__ - 1L,
14 _Static_assert([typeof(IMM1)] == [int], "");
16 enum bound_int_maxm2 {
17 IMM2 = -__INT_MAX__ - 2L,
19 _Static_assert([typeof(IMM2)] == [long], "");
22 * check-name: enum-bounds
23 * check-command: sparse -m64 $file
24 * check-assert: sizeof(long) == 8