mtag_data: re-write in terms of mtag/offset
[smatch.git] / validation / sm_user_data3.c
blob7819616fcbaf101fd93d0aadc4aa49f1942f50db
1 #include "check_debug.h"
3 int copy_from_user(void *dest, void *src, int size){}
5 struct my_struct {
6 int x, y;
7 };
9 struct my_struct *returns_filter(struct my_struct *p)
11 return p;
14 struct my_struct *src, *a, *b;
15 void test(void)
17 copy_from_user(a, src, sizeof(*a));
18 b = returns_filter(a);
19 __smatch_user_rl(b->y);
20 b = returns_filter(src);
21 __smatch_user_rl(b->y);
22 b = returns_filter(a);
23 __smatch_user_rl(b->y);
27 * check-name: smatch user data #3
28 * check-command: smatch -p=kernel -I.. sm_user_data3.c
30 * check-output-start
31 sm_user_data3.c:19 test() user rl: 'b->y' = 's32min-s32max'
32 sm_user_data3.c:21 test() user rl: 'b->y' = ''
33 sm_user_data3.c:23 test() user rl: 'b->y' = 's32min-s32max'
34 * check-output-end