1 #include <stdio.h>
2 #include "check_debug.h"
3 
4 struct foo {
5 	int (*func)(struct foo *);
6 	int a, b, c;
7 	int *p;
8 };
9 
frob1(struct foo * p)10 int frob1(struct foo *p)
11 {
12 	__smatch_implied(*p->p);
13 }
14 
frob2(struct foo * p)15 int frob2(struct foo *p)
16 {
17 	__smatch_implied(*p->p);
18 }
19 
20 int x = 42;
21 int y = 43;
22 
23 struct foo aaa = {
24 	.func = frob1,
25 	.a = 1, .b = 2, .c = 3,
26 	.p = &x,
27 };
28 struct foo bbb = {
29 	.func = frob2,
30 	.a = 10, .b = 11, .c = 13,
31 	.p = &y,
32 };
33 
main(void)34 int main(void)
35 {
36 	aaa.func(&aaa);
37 	bbb.func(&bbb);
38 	return 0;
39 }
40 
41 /*
42  * check-name: smatch mtag #7
43  * check-command: validation/smatch_db_test.sh -I.. sm_mtag7.c
44  *
45  * check-output-start
46 sm_mtag7.c:12 frob1() implied: *p->p = '42'
47 sm_mtag7.c:17 frob2() implied: *p->p = '43'
48  * check-output-end
49  */
50