*new* check_string_len.c: look for sprintf() overflows
[smatch.git] / validation / sm_range2.c
blob2bfc676e2100458cc409eda2a6f4c3c97d9e73eb
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() a = s32min-(-1),1-s32max
34 sm_range2.c:8 frob() a = 0
35 sm_range2.c:9 frob() a = s32min-s32max
36 sm_range2.c:12 frob() b = 0
37 sm_range2.c:14 frob() b = s32min-s32max
38 sm_range2.c:17 frob() c = s32min-s32max
39 sm_range2.c:20 frob() d = (-3)-99
40 sm_range2.c:25 frob() d = (-3)-99
41 sm_range2.c:26 frob() e = s32min-s32max
42 * check-output-end