math: use comparisons to handle subtraction better
[smatch.git] / validation / sm_casts5.c
blobe3c96d6652d8b64e3a161ff3f446b80b8fbb86bb
1 #include <stdio.h>
2 #include <string.h>
3 #include "check_debug.h"
5 long long l;
6 long long ul;
7 int i;
8 int ui;
9 signed char c;
10 char uc;
12 int main(void)
14 int idx;
16 if (c < -2)
17 return 1;
18 if (uc < (unsigned int)-2)
19 return 1;
20 if (i < -2)
21 return 1;
22 if (ui < (unsigned int)-2)
23 return 1;
24 if (l < -2)
25 return 1;
26 if (ul < (unsigned int)-2)
27 return 1;
29 __smatch_implied(l);
30 __smatch_implied(ul);
31 __smatch_implied(i);
32 __smatch_implied(ui);
33 __smatch_implied(c);
34 __smatch_implied(uc);
36 return 0;
41 * check-name: smatch: casts #5
42 * check-command: smatch -I.. sm_casts5.c
44 * check-output-start
45 sm_casts5.c:29 main() implied: l = '(-2)-s64max'
46 sm_casts5.c:30 main() implied: ul = '4294967294-s64max'
47 sm_casts5.c:31 main() implied: i = '(-2)-s32max'
48 sm_casts5.c:32 main() implied: ui = '(-2)-(-1)'
49 sm_casts5.c:33 main() implied: c = '(-2)-127'
50 sm_casts5.c:34 main() implied: uc = '(-2)-(-1)'
51 * check-output-end