xref: /illumos-gate/usr/src/tools/smatch/src/validation/struct-as.c (revision d865fc92e4b640c73c2957a20b3d82622c741be5)
1 /*
2  * Structure members should get the address
3  * space of their pointer.
4  */
5 #define __user __attribute__((address_space(1)))
6 
7 struct hello {
8 	int a;
9 };
10 
11 extern int test(int __user *ip);
12 
13 static int broken(struct hello __user *sp)
14 {
15 	return test(&sp->a);
16 }
17 /*
18  * check-name: Address space of a struct member
19  */
20