sparse, llvm: fix phi generation
[smatch.git] / validation / foul-bitwise.c
blob4b542cf94000b44b1b66637a1035510f13be31c0
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: warning: restricted __le16 degrades to integer
28 foul-bitwise.c:19:16: warning: incorrect type in return expression (different base types)
29 foul-bitwise.c:19:16: expected restricted __le16
30 foul-bitwise.c:19:16: got int
31 * check-error-end