db/fixup_kernel.sh: fix clear_user() handling
[smatch.git] / validation / type-attribute-as.c
blob38f06b374e25d6acfda70a263edbf330e4f9293b
1 #define __as __attribute__((address_space(__as)))
3 struct s {
4 int i;
5 } __as;
8 extern void use0(void *);
9 extern void use1(void __as *);
11 void main(void)
13 struct s s;
14 int i;
16 use0(&s); // KO
17 use0(&i); // OK
18 use1(&s); // OK
19 use1(&i); // KO
23 * check-name: type-attribute-as
25 * check-error-start
26 type-attribute-as.c:16:15: warning: incorrect type in argument 1 (different address spaces)
27 type-attribute-as.c:16:15: expected void *
28 type-attribute-as.c:16:15: got struct s __as *
29 type-attribute-as.c:19:15: warning: incorrect type in argument 1 (different address spaces)
30 type-attribute-as.c:19:15: expected void __as *
31 type-attribute-as.c:19:15: got int *
32 * check-error-end