param_cleared: handle direct assignments
[smatch.git] / validation / sm_compare3.c
blob1d73839516dfd554b162a54fa7de07c8da8e7fbe
1 #include <stdio.h>
2 #include <string.h>
3 #include "check_debug.h"
5 int a, b, c, d;
6 int e, f, g;
7 int main(void)
9 if (a >= b)
10 return 1;
11 if (a < 0 || b < 0)
12 return 1;
13 c = b - a;
14 __smatch_implied(c);
15 __smatch_compare(b, c);
17 if (e < 0 || e > b)
18 return;
19 if (f <= 0 || f > b)
20 return;
21 g = e + f;
23 __smatch_implied(g);
24 __smatch_implied(e);
25 __smatch_compare(g, e);
26 __smatch_compare(e, g);
27 __smatch_implied(g - e);
28 __smatch_implied(g - f);
30 return 0;
35 * check-name: Smatch compare #3
36 * check-command: smatch -I.. sm_compare3.c
38 * check-output-start
39 sm_compare3.c:14 main() implied: c = '1-s32max'
40 sm_compare3.c:15 main() b <= c
41 sm_compare3.c:23 main() implied: g = '1-s32max'
42 sm_compare3.c:24 main() implied: e = '0-s32max'
43 sm_compare3.c:25 main() g > e
44 sm_compare3.c:26 main() e < g
45 sm_compare3.c:27 main() implied: g - e = '1-s32max'
46 sm_compare3.c:28 main() implied: g - f = '0-s32max'
47 * check-output-end