extra: get max correctly
[smatch.git] / validation / foul-bitwise.c
blob9e21eab7bf2f41d65c7f9083873b41504c1ff5ae
1 typedef unsigned short __attribute__((bitwise))__le16;
2 static __le16 foo(__le16 a)
4 return a |= ~a;
7 static int baz(__le16 a)
9 return ~a == ~a;
12 static int barf(__le16 a)
14 return a == (a & ~a);
17 static __le16 bar(__le16 a)
19 return -a;
23 * check-name: foul bitwise
24 * check-error-start
25 foul-bitwise.c:9:16: warning: restricted __le16 degrades to integer
26 foul-bitwise.c:9:22: warning: restricted __le16 degrades to integer
27 foul-bitwise.c:19:16: error: incompatible types for operation (-)
28 foul-bitwise.c:19:16: argument has type restricted __le16 [usertype] a
29 * check-error-end