1 /* Copyright (C) 2003 Free Software Foundation, Inc.
2    Test builtin preprocessor assertions.
3    By Kaveh Ghazi <ghazi@caip.rutgers.edu>.  */
4 
5 /* { dg-do preprocess } */
6 
7 /* Check for #system assertions.  */
8 
9 #if defined __gnu_linux__
10 # if !#system(linux) || !#system(unix) || !#system(posix)
11 #  error
12 # endif
13 #elif #system(linux)
14 # error
15 #endif
16 
17 #if defined __gnu_hurd__
18 # if !#system(gnu) || !#system(unix) || !#system(posix) || !#system(mach)
19 #  error
20 # endif
21 #elif #system(gnu)
22 # error
23 #endif
24 
25 #if defined __FreeBSD__
26 # if !#system(FreeBSD) || !#system(unix) || !#system(bsd)
27 #  error
28 # endif
29 #elif #system(FreeBSD)
30 # error
31 #endif
32 
33 #if defined __NetBSD__
34 # if !#system(NetBSD) || !#system(unix) || !#system(bsd)
35 #  error
36 # endif
37 #elif #system(NetBSD)
38 # error
39 #endif
40 
41 #if defined __OpenBSD__
42 # if !#system(OpenBSD) || !#system(unix) || !#system(bsd)
43 #  error
44 # endif
45 #elif #system(OpenBSD)
46 # error
47 #endif
48 
49 #if defined __svr4__ || defined __SYSTYPE_SVR4__
50 # if !#system(svr4) || !#system(unix)
51 #  error
52 # endif
53 #elif #system(svr4)
54 # error
55 #endif
56 
57 #if defined __hpux__
58 # if !#system(hpux) || !#system(unix)
59 #  error
60 # endif
61 #elif #system(hpux)
62 # error
63 #endif
64 
65 #if defined _AIX
66 # if !#system(aix) || !#system(unix)
67 #  error
68 # endif
69 #elif #system(aix)
70 # error
71 #endif
72 
73 #if defined __lynx__
74 # if !#system(lynx) || !#system(unix)
75 #  error
76 # endif
77 #elif #system(lynx)
78 # error
79 #endif
80 
81 #if defined __unix__
82 # if !#system(unix)
83 #  error
84 # endif
85 #elif #system(unix)
86 # error
87 #endif
88 
89 #if defined __rtems__
90 # if !#system(rtems)
91 #  error
92 # endif
93 #elif #system(rtems)
94 # error
95 #endif
96 
97 #if defined __vms__
98 # if !#system(vms)
99 #  error
100 # endif
101 #elif #system(vms)
102 # error
103 #endif
104 
105 #if defined __mvs__
106 # if !#system(mvs)
107 #  error
108 # endif
109 #elif #system(mvs)
110 # error
111 #endif
112 
113 #if defined __MSDOS__
114 # if !#system(msdos)
115 #  error
116 # endif
117 #elif #system(msdos)
118 # error
119 #endif
120 
121 #if defined __WINNT__
122 # if !#system(winnt)
123 #  error
124 # endif
125 #elif #system(winnt)
126 # error
127 #endif
128 
129 #if defined __BEOS__
130 # if !#system(beos)
131 #  error
132 # endif
133 #elif #system(beos)
134 # error
135 #endif
136 
137 #if defined __netware__
138 # if !#system(netware)
139 #  error
140 # endif
141 #elif #system(netware)
142 # error
143 #endif
144 
145 
146 /* Check for #cpu and #machine assertions.  */
147 
148 #if defined __arc__
149 # if !#cpu(arc) || !#machine(arc)
150 #  error
151 # endif
152 #elif #cpu(arc) || #machine(arc)
153 # error
154 #endif
155 
156 #if defined __alpha__
157 # if !#cpu(alpha) || !#machine(alpha) \
158 	|| (defined __alpha_cix__ && !#cpu(cix)) \
159 	|| (!defined __alpha_cix__ && #cpu(cix)) \
160 	|| (defined __alpha_fix__ && !#cpu(fix)) \
161 	|| (!defined __alpha_fix__ && #cpu(fix)) \
162 	|| (defined __alpha_bwx__ && !#cpu(bwx)) \
163 	|| (!defined __alpha_bwx__ && #cpu(bwx)) \
164 	|| (defined __alpha_max__ && !#cpu(max)) \
165 	|| (!defined __alpha_max__ && #cpu(max)) \
166 	|| (defined __alpha_ev6__ && !#cpu(ev6)) \
167 	|| (!defined __alpha_ev6__ && #cpu(ev6)) \
168 	|| (defined __alpha_ev5__ && !#cpu(ev5)) \
169 	|| (!defined __alpha_ev5__ && #cpu(ev5)) \
170 	|| (defined __alpha_ev4__ && !#cpu(ev4)) \
171 	|| (!defined __alpha_ev4__ && #cpu(ev4))
172 #  error
173 # endif
174 #elif #cpu(alpha) || #machine(alpha) || #cpu(cix) || #cpu(fix) || #cpu(bwx) \
175 	|| #cpu(max) || #cpu(ev6) || #cpu(ev5) || #cpu(ev4)
176 # error
177 #endif
178 
179 #if defined __arm__
180 # if !#cpu(arm) || !#machine(arm)
181 #  error
182 # endif
183 #elif #cpu(arm) || #machine(arm)
184 # error
185 #endif
186 
187 #if defined __cris__
188 # if !#cpu(cris) || !#machine(cris)
189 #  error
190 # endif
191 #elif #cpu(cris) || #machine(cris)
192 # error
193 #endif
194 
195 #if defined __d30v__
196 # if !#cpu(d30v) || !#machine(d30v)
197 #  error
198 # endif
199 #elif #cpu(d30v) || #machine(d30v)
200 # error
201 #endif
202 
203 #if defined __fr30__
204 # if !#cpu(fr30) || !#machine(fr30)
205 #  error
206 # endif
207 #elif #cpu(fr30) || #machine(fr30)
208 # error
209 #endif
210 
211 #if defined __frv__
212 # if !#cpu(frv) || !#machine(frv)
213 #  error
214 # endif
215 #elif #cpu(frv) || #machine(frv)
216 # error
217 #endif
218 
219 #if defined __h8300__
220 # if !#cpu(h8300) || !#machine(h8300) \
221   || (defined __H8300__ && (!#cpu(h8300) || !#machine(h8300))) \
222   || (defined __H8300H__ && (!#cpu(h8300h) || !#machine(h8300h))) \
223   || (!defined __H8300H__ && (#cpu(h8300h) || #machine(h8300h))) \
224   || (defined __H8300S__ && (!#cpu(h8300s) || !#machine(h8300s))) \
225   || (!defined __H8300S__ && (#cpu(h8300s) || #machine(h8300s)))
226 #  error
227 # endif
228 #elif #cpu(h8300) || #machine(h8300) || #cpu(h8300h) || #machine(h8300h) || \
229   #cpu(h8300s) || #machine(h8300s)
230 # error
231 #endif
232 
233 #if defined __hppa__
234 # if !#cpu(hppa) || !#machine(hppa)
235 #  error
236 # endif
237 #elif #cpu(hppa) || #machine(hppa)
238 # error
239 #endif
240 
241 #if defined __i370__
242 # if !#cpu(i370) || !#machine(i370)
243 #  error
244 # endif
245 #elif #cpu(i370) || #machine(i370)
246 # error
247 #endif
248 
249 #if defined __x86_64__
250 # if !#cpu(x86_64) || !#machine(x86_64)
251 #  error
252 # endif
253 #elif #cpu(x86_64) || #machine(x86_64)
254 # error
255 #endif
256 
257 #if defined __i386__
258 # if !#cpu(i386) || !#machine(i386)
259 #  error
260 # endif
261 #elif #cpu(i386) || #machine(i386)
262 # error
263 #endif
264 
265 #if defined __i860__
266 # if !#cpu(i860) || !#machine(i860)
267 #  error
268 # endif
269 #elif #cpu(i860) || #machine(i860)
270 # error
271 #endif
272 
273 #if defined __i960__
274 # if !#cpu(i960) || !#machine(i960)
275 #  error
276 # endif
277 #elif #cpu(i960) || #machine(i960)
278 # error
279 #endif
280 
281 #if defined __ia64__
282 # if !#cpu(ia64) || !#machine(ia64)
283 #  error
284 # endif
285 #elif #cpu(ia64) || #machine(ia64)
286 # error
287 #endif
288 
289 #if defined __iq2000__
290 # if !#cpu(iq2000) || !#machine(iq2000)
291 #  error
292 # endif
293 #elif #cpu(iq2000) || #machine(iq2000)
294 # error
295 #endif
296 
297 #if defined __M32R__
298 # if !#cpu(m32r) || !#machine(m32r)
299 #  error
300 # endif
301 #elif #cpu(m32r) || #machine(m32r)
302 # error
303 #endif
304 
305 #if defined __m68k__
306 # if !#cpu(m68k) || !#machine(m68k)
307 #  error
308 # endif
309 #elif #cpu(m68k) || #machine(m68k)
310 # error
311 #endif
312 
313 #if defined __mcore__
314 # if !#cpu(mcore) || !#machine(mcore)
315 #  error
316 # endif
317 #elif #cpu(mcore) || #machine(mcore)
318 # error
319 #endif
320 
321 #if defined __mips__
322 # if !#cpu(mips) || (defined __sgi__ && !#machine(sgi)) \
323   || (!defined __sgi__ && !#machine(mips))
324 #  error
325 # endif
326 #elif #cpu(mips) || #machine(sgi) || #machine(mips)
327 # error
328 #endif
329 
330 #if defined __mmix__
331 # if !#cpu(mmix) || !#machine(mmix)
332 #  error
333 # endif
334 #elif #cpu(mmix) || #machine(mcore)
335 # error
336 #endif
337 
338 #if defined __mn10300__
339 # if !#cpu(mn10300) || !#machine(mn10300)
340 #  error
341 # endif
342 #elif #cpu(mn10300) || #machine(mn10300)
343 # error
344 #endif
345 
346 #if defined __ns32k__
347 # if !#cpu(ns32k) || !#machine(ns32k)
348 #  error
349 # endif
350 #elif #cpu(ns32k) || #machine(ns32k)
351 # error
352 #endif
353 
354 #if defined __pdp11__
355 # if !#cpu(pdp11) || !#machine(pdp11)
356 #  error
357 # endif
358 #elif #cpu(pdp11) || #machine(pdp11)
359 # error
360 #endif
361 
362 #if defined __powerpc__
363 # if defined __powerpc64__
364 #  if (#cpu(powerpc) || #machine(powerpc) \
365        || !#cpu(powerpc64) || !#machine(powerpc64))
366 #   error
367 #  endif
368 # else
369 #  if (!#cpu(powerpc) || !#machine(powerpc) \
370        || #cpu(powerpc64) || #machine(powerpc64))
371 #   error
372 #  endif
373 # endif
374 #elif (#cpu(powerpc) || #machine(powerpc) \
375        || #cpu(powerpc64) || #machine(powerpc64))
376 # error
377 #endif
378 
379 #if defined __rs6000__
380 # if !#cpu(rs6000) || !#machine(rs6000)
381 #  error
382 # endif
383 #elif #cpu(rs6000) || #machine(rs6000)
384 # error
385 #endif
386 
387 #if defined __s390__
388 # if !#cpu(s390) || !#machine(s390)
389 #  error
390 # endif
391 #elif #cpu(s390) || #machine(s390)
392 # error
393 #endif
394 
395 #if defined __sh__
396 # if !#cpu(sh) || !#machine(sh)
397 #  error
398 # endif
399 #elif #cpu(sh) || #machine(sh)
400 # error
401 #endif
402 
403 #if defined __sparc__
404 # if (defined __arch64__ \
405       && (!#cpu(sparc64) || !#machine(sparc64) || #cpu(sparc) || #machine(sparc)))
406   || (!defined __arch64__ \
407       && (#cpu(sparc64) || #machine(sparc64) || !#cpu(sparc) || !#machine(sparc)))
408 #  error
409 # endif
410 #elif #cpu(sparc64) || #machine(sparc64) || #cpu(sparc) || #machine(sparc)
411 # error
412 #endif
413 
414 #if defined __xstormy16__
415 # if !#cpu(xstormy16) || !#machine(xstormy16)
416 #  error
417 # endif
418 #elif #cpu(xstormy16) || #machine(xstormy16)
419 # error
420 #endif
421 
422 #if defined __v850__
423 # if !#cpu(v850) || !#machine(v850)
424 #  error
425 # endif
426 #elif #cpu(v850) || #machine(v850)
427 # error
428 #endif
429 
430 #if defined __vax__
431 # if !#cpu(vax) || !#machine(vax)
432 #  error
433 # endif
434 #elif #cpu(vax) || #machine(vax)
435 # error
436 #endif
437 
438 #if defined __XTENSA__
439 # if !#cpu(xtensa) || !#machine(xtensa)
440 #  error
441 # endif
442 #elif #cpu(xtensa) || #machine(xtensa)
443 # error
444 #endif
445 
446