extra: fix bug handling untracked pointers
[smatch.git] / validation / sm_compare3.c
blob6209790ebaa62d292f3ac572d02baa272f317849
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 (b > 1000000000)
10 return 0;
12 if (a >= b)
13 return 1;
14 if (a < 0 || b < 0)
15 return 1;
16 c = b - a;
17 __smatch_implied(c);
18 __smatch_compare(b, c);
20 if (e < 0 || e > b)
21 return;
22 if (f <= 0 || f > b)
23 return;
24 g = e + f;
26 __smatch_implied(g);
27 __smatch_implied(e);
28 __smatch_compare(g, e);
29 __smatch_compare(e, g);
30 __smatch_implied(g - e);
31 __smatch_implied(g - f);
33 return 0;
37 * check-name: Smatch compare #3
38 * check-command: smatch -I.. sm_compare3.c
40 * check-output-start
41 sm_compare3.c:17 main() implied: c = '1-1000000000'
42 sm_compare3.c:18 main() b <= c
43 sm_compare3.c:26 main() implied: g = '1-2000000000'
44 sm_compare3.c:27 main() implied: e = '0-1000000000'
45 sm_compare3.c:28 main() g > e
46 sm_compare3.c:29 main() e < g
47 sm_compare3.c:30 main() implied: g - e = '1-2000000000'
48 sm_compare3.c:31 main() implied: g - f = '0-1999999999'
49 * check-output-end