1#define	__noderef	__attribute__((noderef))
2#define	__bitwise	__attribute__((bitwise))
3#define	__nocast	__attribute__((nocast))
4#define	__safe		__attribute__((safe))
5
6static void test_spec(void)
7{
8	unsigned int obj, *ptr;
9	typeof(obj) var = obj;
10	typeof(ptr) ptr2 = ptr;
11	typeof(*ptr) var2 = obj;
12	typeof(*ptr) *ptr3 = ptr;
13	typeof(obj) *ptr4 = ptr;
14	obj = obj;
15	ptr = ptr;
16	ptr = &obj;
17	obj = *ptr;
18}
19
20static void test_const(void)
21{
22	const int obj, *ptr;
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;
28	ptr = ptr;
29	ptr = &obj;
30}
31
32static void test_volatile(void)
33{
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;
40	obj = obj;
41	ptr = ptr;
42	ptr = &obj;
43	obj = *ptr;
44}
45
46static void test_restrict(void)
47{
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;
54	obj = obj;
55	ptr = ptr;
56	ptr = &obj;
57	obj = *ptr;
58}
59
60static void test_atomic(void)
61{
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;
68	obj = obj;
69	ptr = ptr;
70	ptr = &obj;
71	obj = *ptr;
72}
73
74static void test_bitwise(void)
75{
76	typedef int __bitwise type_t;
77	type_t obj, *ptr;
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;
83	obj = obj;
84	ptr = ptr;
85	ptr = &obj;
86	obj = *ptr;
87}
88
89static void test_static(void)
90{
91	static int obj, *ptr;
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;
97	obj = obj;
98	ptr = ptr;
99	ptr = &obj;
100	obj = *ptr;
101}
102
103static void test_tls(void)
104{
105	__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;
111	obj = obj;
112	ptr = ptr;
113	ptr = &obj;
114	obj = *ptr;
115}
116
117static void test_nocast(void)
118{
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;
125	obj = obj;
126	ptr = ptr;
127	ptr = &obj;
128	obj = *ptr;
129}
130
131/*
132 * check-name: typeof-mods
133 *
134 * check-error-start
135 * check-error-end
136 */
137