flow: struct_assignments: turn this code on
[smatch.git] / validation / sm_user_data1.c
blob3b4d1064fa3b13953960d40c530828400afa9ce4
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 void *pointer;
11 void copy_stuff(struct my_struct *foo)
13 copy_from_user(foo, pointer, sizeof(*foo));
16 void test(void)
18 struct my_struct foo;
20 copy_stuff(&foo);
21 __smatch_state("check_user_data", "foo.x");
24 * check-name: smatch user data #1
25 * check-command: smatch -p=kernel -I.. sm_user_data1.c
27 * check-output-start
28 sm_user_data1.c:21 test() 'foo.x' = 'user_data_set'
29 * check-output-end