rosenberg: handle bit fields better
[smatch.git] / validation / sm_mtag1.c
blobee742f6d62cbe46981d5ecd972252fd7643b9f1c
1 #include <stdio.h>
2 #include "check_debug.h"
4 static int xxx = 234;
6 struct foo {
7 int a, b, c;
8 int (*func)(struct foo *p);
9 };
11 static int frob1(struct foo *p)
13 printf("%d\n", p->a);
14 __smatch_implied(p->a);
15 return p->a + 1;
17 static int frob2(struct foo *p)
19 printf("%d\n", p->a);
20 __smatch_implied(p->a);
21 return p->a + 1;
24 static struct foo one_struct = {
25 .a = 1,
26 .func = frob1,
28 static struct foo two_struct = {
29 .a = 2,
30 .func = frob2,
33 int main(void)
35 struct foo *p = &one_struct;
36 int ret;
38 ret = p->func(p);
39 // __smatch_implied(ret);
41 return 0;
45 * check-name: smatch mtag #1
46 * check-command: validation/smatch_db_test.sh -I.. sm_mtag1.c
48 * check-output-start
49 sm_mtag1.c:14 frob1() implied: p->a = '1'
50 sm_mtag1.c:20 frob2() implied: p->a = '2'
51 * check-output-end