1 #include "check_debug.h"
2
3 void memset(void *p, char pat, int size);
4
5 struct foo {
6 int a, b;
7 };
8
9 void my_func(struct foo *p)
10 {
11 memset(p, 0, sizeof(*p));
12 p->a = 1;
13 }
14
15 struct foo *my_pointer;
16
17 void test(void)
18 {
19 struct foo foo;
20
21 my_func(my_pointer);
22 my_func(&foo);
23 __smatch_implied(my_pointer->a);
24 __smatch_implied(my_pointer->b);
25 __smatch_implied(foo.a);
26 __smatch_implied(foo.b);
27 }
28
29 /*
30 * check-name: smatch: inline #3
31 * check-command: smatch -I.. sm_inline3.c
32 *
33 * check-output-start
34 sm_inline3.c:23 test() implied: my_pointer->a = '1'
35 sm_inline3.c:24 test() implied: my_pointer->b = '0'
36 sm_inline3.c:25 test() implied: foo.a = '1'
37 sm_inline3.c:26 test() implied: foo.b = '0'
38 * check-output-end
39 */