1 #define __user __attribute__((address_space(1)))
2 #define __noderef __attribute__((noderef))
3 #define __bitwise __attribute__((bitwise))
4 #define __nocast __attribute__((nocast))
5 #define __safe __attribute__((safe))
8 /* Should be inherited? */
9 static void test_const(void)
12 int *p
= &o
; /* check-should-fail */
15 static void test_volatile(void)
18 int *p
= &o
; /* check-should-fail */
21 static void test_noderef(void)
24 int *p
= &o
; /* check-should-fail */
27 static void test_bitwise(void)
30 int *p
= &o
; /* check-should-fail */
33 static void test_user(void)
36 int *p
= &o
; /* check-should-fail */
39 static void test_nocast(void)
42 int __nocast
*p
= &o
; /* check-should-pass */
45 /* Should be ignored? */
46 static void test_static(void)
48 /* storage is not inherited */
50 int *p
= &o
; /* check-should-pass */
53 static void test_tls(void)
55 /* storage is not inherited */
56 static __thread
int o
;
57 int *p
= &o
; /* check-should-pass */
61 * check-name: ptr-inherit.c
64 ptr-inherit.c:12:19: warning: incorrect type in initializer (different modifiers)
65 ptr-inherit.c:12:19: expected int *p
66 ptr-inherit.c:12:19: got int const *<noident>
67 ptr-inherit.c:18:19: warning: incorrect type in initializer (different modifiers)
68 ptr-inherit.c:18:19: expected int *p
69 ptr-inherit.c:18:19: got int volatile *<noident>
70 ptr-inherit.c:24:19: warning: incorrect type in initializer (different modifiers)
71 ptr-inherit.c:24:19: expected int *p
72 ptr-inherit.c:24:19: got int [noderef] *<noident>
73 ptr-inherit.c:30:19: warning: incorrect type in initializer (different base types)
74 ptr-inherit.c:30:19: expected int *p
75 ptr-inherit.c:30:19: got restricted int *<noident>
76 ptr-inherit.c:36:19: warning: incorrect type in initializer (different address spaces)
77 ptr-inherit.c:36:19: expected int *p
78 ptr-inherit.c:36:19: got int <asn:1>*<noident>