slice: remove unneeded nr_nrbits from EXPR_SLICE
[smatch.git] / validation / tautological-compare.c
blob55a2b463968e709131e8610d4f77654c0f263f62
1 typedef unsigned int u32;
3 int seq(int a) { return a == a; }
4 int sne(int a) { return a != a; }
5 int slt(int a) { return a < a; }
6 int sgt(int a) { return a > a; }
7 int sle(int a) { return a <= a; }
8 int sge(int a) { return a >= a; }
10 u32 ueq(u32 a) { return a == a; }
11 u32 une(u32 a) { return a != a; }
12 u32 ult(u32 a) { return a < a; }
13 u32 ugt(u32 a) { return a > a; }
14 u32 ule(u32 a) { return a <= a; }
15 u32 uge(u32 a) { return a >= a; }
18 * check-name: tautological-compare
19 * check-command: sparse -Wno-decl -Wtautological-compare $file
21 * check-error-start
22 tautological-compare.c:3:30: warning: self-comparison always evaluates to true
23 tautological-compare.c:4:30: warning: self-comparison always evaluates to false
24 tautological-compare.c:5:29: warning: self-comparison always evaluates to false
25 tautological-compare.c:6:29: warning: self-comparison always evaluates to false
26 tautological-compare.c:7:30: warning: self-comparison always evaluates to true
27 tautological-compare.c:8:30: warning: self-comparison always evaluates to true
28 tautological-compare.c:10:30: warning: self-comparison always evaluates to true
29 tautological-compare.c:11:30: warning: self-comparison always evaluates to false
30 tautological-compare.c:12:29: warning: self-comparison always evaluates to false
31 tautological-compare.c:13:29: warning: self-comparison always evaluates to false
32 tautological-compare.c:14:30: warning: self-comparison always evaluates to true
33 tautological-compare.c:15:30: warning: self-comparison always evaluates to true
34 * check-error-end