implied: tweak some debug statements
[smatch.git] / validation / sm_user_data4.c
bloba249ea0db4085a8a34b5f83830ea45dd901c3197
1 #include "check_debug.h"
3 int copy_from_user(void *dest, void *src, int size);
5 struct ear {
6 int x, y;
7 };
9 void *src;
10 int returns_user_data(void)
12 int x;
14 copy_from_user(&x, src, sizeof(int));
15 return x;
18 struct ear *dest;
19 struct ear *returns_user_member(void)
21 copy_from_user(&dest->x, src, sizeof(int));
22 return dest;
24 void test(void)
26 struct ear *p;
27 int x;
29 x = returns_user_data();
30 __smatch_user_rl(x);
31 p = returns_user_member();
32 __smatch_user_rl(p);
33 __smatch_user_rl(p->x);
37 * check-name: smatch user data #4
38 * check-command: smatch -p=kernel -I.. sm_user_data4.c
40 * check-output-start
41 sm_user_data4.c:30 test() user rl: 'x' = 's32min-s32max'
42 sm_user_data4.c:32 test() user rl: 'p' = ''
43 sm_user_data4.c:33 test() user rl: 'p->x' = 's32min-s32max'
44 * check-output-end