1 #define __noderef __attribute__((noderef))
2 #define __bitwise __attribute__((bitwise))
3 #define __nocast __attribute__((nocast))
4 #define __safe __attribute__((safe))
6 static void test_spec(void)
8 unsigned int obj
, *ptr
;
10 typeof(ptr
) ptr2
= ptr
;
11 typeof(*ptr
) var2
= obj
;
12 typeof(*ptr
) *ptr3
= ptr
;
13 typeof(obj
) *ptr4
= ptr
;
20 static void test_const(void)
23 typeof(obj
) var
= obj
;
24 typeof(ptr
) ptr2
= ptr
;
25 typeof(*ptr
) var2
= obj
;
26 typeof(*ptr
) *ptr3
= ptr
;
27 typeof(obj
) *ptr4
= ptr
;
32 static void test_volatile(void)
34 volatile int obj
, *ptr
;
35 typeof(obj
) var
= obj
;
36 typeof(ptr
) ptr2
= ptr
;
37 typeof(*ptr
) var2
= obj
;
38 typeof(*ptr
) *ptr3
= ptr
;
39 typeof(obj
) *ptr4
= ptr
;
46 static void test_restrict(void)
48 int *restrict obj
, *restrict
*ptr
;
49 typeof(obj
) var
= obj
;
50 typeof(ptr
) ptr2
= ptr
;
51 typeof(*ptr
) var2
= obj
;
52 typeof(*ptr
) *ptr3
= ptr
;
53 typeof(obj
) *ptr4
= ptr
;
60 static void test_atomic(void)
62 int _Atomic obj
, *ptr
;
63 typeof(obj
) var
= obj
;
64 typeof(ptr
) ptr2
= ptr
;
65 typeof(*ptr
) var2
= obj
;
66 typeof(*ptr
) *ptr3
= ptr
;
67 typeof(obj
) *ptr4
= ptr
;
74 static void test_bitwise(void)
76 typedef int __bitwise type_t
;
78 typeof(obj
) var
= obj
;
79 typeof(ptr
) ptr2
= ptr
;
80 typeof(*ptr
) var2
= obj
;
81 typeof(*ptr
) *ptr3
= ptr
;
82 typeof(obj
) *ptr4
= ptr
;
89 static void test_static(void)
92 typeof(obj
) var
= obj
;
93 typeof(ptr
) ptr2
= ptr
;
94 typeof(*ptr
) var2
= obj
;
95 typeof(*ptr
) *ptr3
= ptr
;
96 typeof(obj
) *ptr4
= ptr
;
103 static void test_tls(void)
105 static __thread
int obj
, *ptr
;
106 typeof(obj
) var
= obj
;
107 typeof(ptr
) ptr2
= ptr
;
108 typeof(*ptr
) var2
= obj
;
109 typeof(*ptr
) *ptr3
= ptr
;
110 typeof(obj
) *ptr4
= ptr
;
117 static void test_nocast(void)
119 int __nocast obj
, *ptr
;
120 typeof(obj
) var
= obj
;
121 typeof(ptr
) ptr2
= ptr
;
122 typeof(*ptr
) var2
= obj
;
123 typeof(*ptr
) *ptr3
= ptr
;
124 typeof(obj
) *ptr4
= ptr
;
132 * check-name: typeof-mods