helper: handle assignments in expr_to_str()
[smatch.git] / validation / sm_select_assign.c
blobc2cbda0636f17050d318b90beac0b5fba53091e0
1 #include "check_debug.h"
3 void frob();
5 #define min(a, b) ((a) < (b) ? (a) : (b))
7 void func(void)
9 int i;
10 int val;
12 for (i = 0; i < 10; i++) {
13 val = min(5, i);
14 __smatch_value("val");
17 i++;
18 __smatch_value("i");
19 val = min(100, i);
20 __smatch_value("val");
22 for (i = 0; i < 10; i++)
23 frob();
25 val = min(100, i);
26 __smatch_value("val");
29 * check-name: assigning select statements
30 * check-command: smatch -I.. sm_select_assign.c
32 * check-output-start
33 sm_select_assign.c:14 func() val = 0-5
34 sm_select_assign.c:18 func() i = 11-s32max
35 sm_select_assign.c:20 func() val = 11-100
36 sm_select_assign.c:26 func() val = 10
37 * check-output-end