extra: cleanup: rename do_comparison_range() => do_comparison()
[smatch.git] / validation / sm_range2.c
blobb3b09195b2170ec8d566c5c5ef2989a295db1e7f
1 #include "check_debug.h"
2 int some_func();
3 int a, b, c, d, e;
4 int frob(void) {
5 if (a)
6 __smatch_value("a");
7 else
8 __smatch_value("a");
9 __smatch_value("a");
10 if (a) {
11 b = 0;
12 __smatch_value("b");
14 __smatch_value("b");
15 c = 0;
16 c = some_func();
17 __smatch_value("c");
18 if (d < -3 || d > 99)
19 return;
20 __smatch_value("d");
21 if (d) {
22 if (!e)
23 return;
25 __smatch_value("d");
26 __smatch_value("e");
29 * check-name: Smatch range test #2
30 * check-command: smatch -I.. sm_range2.c
32 * check-output-start
33 sm_range2.c +6 frob(2) a = min-(-1),1-max
34 sm_range2.c +8 frob(4) a = 0
35 sm_range2.c +9 frob(5) a = min-max
36 sm_range2.c +12 frob(8) b = 0
37 sm_range2.c +14 frob(10) b = min-max
38 sm_range2.c +17 frob(13) c = unknown
39 sm_range2.c +20 frob(16) d = (-3)-99
40 sm_range2.c +25 frob(21) d = (-3)-99
41 sm_range2.c +26 frob(22) e = min-max
42 * check-output-end