Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / gcc.dg / cpp / assert4.c
blobf03d89fbadf0667c7202650c072e97432fc7b9a7
1 /* Copyright (C) 2003 Free Software Foundation, Inc.
2 Test builtin preprocessor assertions.
3 By Kaveh Ghazi <ghazi@caip.rutgers.edu>. */
5 /* { dg-do preprocess } */
7 /* Check for #system assertions. */
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
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
25 #if defined __FreeBSD__
26 # if !#system(FreeBSD) || !#system(unix) || !#system(bsd)
27 # error
28 # endif
29 #elif #system(FreeBSD)
30 # error
31 #endif
33 #if defined __NetBSD__
34 # if !#system(NetBSD) || !#system(unix) || !#system(bsd)
35 # error
36 # endif
37 #elif #system(NetBSD)
38 # error
39 #endif
41 #if defined __OpenBSD__
42 # if !#system(OpenBSD) || !#system(unix) || !#system(bsd)
43 # error
44 # endif
45 #elif #system(OpenBSD)
46 # error
47 #endif
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
57 #if defined __hpux__
58 # if !#system(hpux) || !#system(unix)
59 # error
60 # endif
61 #elif #system(hpux)
62 # error
63 #endif
65 #if defined _AIX
66 # if !#system(aix) || !#system(unix)
67 # error
68 # endif
69 #elif #system(aix)
70 # error
71 #endif
73 #if defined __lynx__
74 # if !#system(lynx) || !#system(unix)
75 # error
76 # endif
77 #elif #system(lynx)
78 # error
79 #endif
81 #if ( defined __unix__ && !defined __CYGWIN__ ) || defined _AIX \
82 || defined __vxworks
83 # if !#system(unix)
84 # error
85 # endif
86 #elif #system(unix)
87 # error
88 #endif
90 #if defined __rtems__
91 # if !#system(rtems)
92 # error
93 # endif
94 #elif #system(rtems)
95 # error
96 #endif
98 #if defined __vms__
99 # if !#system(vms)
100 # error
101 # endif
102 #elif #system(vms)
103 # error
104 #endif
106 #if defined __mvs__
107 # if !#system(mvs)
108 # error
109 # endif
110 #elif #system(mvs)
111 # error
112 #endif
114 #if defined __MSDOS__
115 # if !#system(msdos)
116 # error
117 # endif
118 #elif #system(msdos)
119 # error
120 #endif
122 #if defined __WINNT__ || defined __CYGWIN__
123 # if !#system(winnt)
124 # error
125 # endif
126 #elif #system(winnt)
127 # error
128 #endif
130 #if defined __BEOS__
131 # if !#system(beos)
132 # error
133 # endif
134 #elif #system(beos)
135 # error
136 #endif
138 #if defined __netware__
139 # if !#system(netware)
140 # error
141 # endif
142 #elif #system(netware)
143 # error
144 #endif
147 /* Check for #cpu and #machine assertions. */
149 #if defined __arc__
150 # if !#cpu(arc) || !#machine(arc)
151 # error
152 # endif
153 #elif #cpu(arc) || #machine(arc)
154 # error
155 #endif
157 #if defined __alpha__
158 # if !#cpu(alpha) || !#machine(alpha) \
159 || (defined __alpha_cix__ && !#cpu(cix)) \
160 || (!defined __alpha_cix__ && #cpu(cix)) \
161 || (defined __alpha_fix__ && !#cpu(fix)) \
162 || (!defined __alpha_fix__ && #cpu(fix)) \
163 || (defined __alpha_bwx__ && !#cpu(bwx)) \
164 || (!defined __alpha_bwx__ && #cpu(bwx)) \
165 || (defined __alpha_max__ && !#cpu(max)) \
166 || (!defined __alpha_max__ && #cpu(max)) \
167 || (defined __alpha_ev6__ && !#cpu(ev6)) \
168 || (!defined __alpha_ev6__ && #cpu(ev6)) \
169 || (defined __alpha_ev5__ && !#cpu(ev5)) \
170 || (!defined __alpha_ev5__ && #cpu(ev5)) \
171 || (defined __alpha_ev4__ && !#cpu(ev4)) \
172 || (!defined __alpha_ev4__ && #cpu(ev4))
173 # error
174 # endif
175 #elif #cpu(alpha) || #machine(alpha) || #cpu(cix) || #cpu(fix) || #cpu(bwx) \
176 || #cpu(max) || #cpu(ev6) || #cpu(ev5) || #cpu(ev4)
177 # error
178 #endif
180 #if defined __arm__
181 # if !#cpu(arm) || !#machine(arm)
182 # error
183 # endif
184 #elif #cpu(arm) || #machine(arm)
185 # error
186 #endif
188 #if defined __cris__
189 # if !#cpu(cris) || !#machine(cris)
190 # error
191 # endif
192 #elif #cpu(cris) || #machine(cris)
193 # error
194 #endif
196 #if defined __fr30__
197 # if !#cpu(fr30) || !#machine(fr30)
198 # error
199 # endif
200 #elif #cpu(fr30) || #machine(fr30)
201 # error
202 #endif
204 #if defined __frv__
205 # if !#cpu(frv) || !#machine(frv)
206 # error
207 # endif
208 #elif #cpu(frv) || #machine(frv)
209 # error
210 #endif
212 #if defined __H8300__
213 # if !#cpu(h8300) || !#machine(h8300) \
214 || (defined __H8300__ && (!#cpu(h8300) || !#machine(h8300))) \
215 || (defined __H8300H__ && (!#cpu(h8300h) || !#machine(h8300h))) \
216 || (!defined __H8300H__ && (#cpu(h8300h) || #machine(h8300h))) \
217 || (defined __H8300S__ && (!#cpu(h8300s) || !#machine(h8300s))) \
218 || (!defined __H8300S__ && (#cpu(h8300s) || #machine(h8300s)))
219 # error
220 # endif
221 #elif #cpu(h8300) || #machine(h8300) || #cpu(h8300h) || #machine(h8300h) || \
222 #cpu(h8300s) || #machine(h8300s)
223 # error
224 #endif
226 #if defined __hppa__
227 # if !#cpu(hppa) || !#machine(hppa)
228 # error
229 # endif
230 #elif #cpu(hppa) || #machine(hppa)
231 # error
232 #endif
234 #if defined __i370__
235 # if !#cpu(i370) || !#machine(i370)
236 # error
237 # endif
238 #elif #cpu(i370) || #machine(i370)
239 # error
240 #endif
242 #if defined __x86_64__
243 # if !#cpu(x86_64) || !#machine(x86_64)
244 # error
245 # endif
246 #elif #cpu(x86_64) || #machine(x86_64)
247 # error
248 #endif
250 #if defined __i386__
251 # if !#cpu(i386) || !#machine(i386)
252 # error
253 # endif
254 #elif #cpu(i386) || #machine(i386)
255 # error
256 #endif
258 #if defined __ia64__
259 # if !#cpu(ia64) || !#machine(ia64)
260 # error
261 # endif
262 #elif #cpu(ia64) || #machine(ia64)
263 # error
264 #endif
266 #if defined __iq2000__
267 # if !#cpu(iq2000) || !#machine(iq2000)
268 # error
269 # endif
270 #elif #cpu(iq2000) || #machine(iq2000)
271 # error
272 #endif
274 #if defined __M32R__
275 # if !#cpu(m32r) || !#machine(m32r)
276 # error
277 # endif
278 #elif #cpu(m32r) || #machine(m32r)
279 # error
280 #endif
282 #if defined __m68k__
283 # if !#cpu(m68k) || !#machine(m68k)
284 # error
285 # endif
286 #elif #cpu(m68k) || #machine(m68k)
287 # error
288 #endif
290 #if defined __mcore__
291 # if !#cpu(mcore) || !#machine(mcore)
292 # error
293 # endif
294 #elif #cpu(mcore) || #machine(mcore)
295 # error
296 #endif
298 #if defined __mips__
299 # if !#cpu(mips) || (defined __sgi__ && !#machine(sgi)) \
300 || (!defined __sgi__ && !#machine(mips))
301 # error
302 # endif
303 #elif #cpu(mips) || #machine(sgi) || #machine(mips)
304 # error
305 #endif
307 #if defined __mn10300__
308 # if !#cpu(mn10300) || !#machine(mn10300)
309 # error
310 # endif
311 #elif #cpu(mn10300) || #machine(mn10300)
312 # error
313 #endif
315 #if defined __pdp11__
316 # if !#cpu(pdp11) || !#machine(pdp11)
317 # error
318 # endif
319 #elif #cpu(pdp11) || #machine(pdp11)
320 # error
321 #endif
323 #if defined __powerpc__
324 # if defined __powerpc64__
325 # if (#cpu(powerpc) || #machine(powerpc) \
326 || !#cpu(powerpc64) || !#machine(powerpc64))
327 # error
328 # endif
329 # else
330 # if (!#cpu(powerpc) || !#machine(powerpc) \
331 || #cpu(powerpc64) || #machine(powerpc64))
332 # error
333 # endif
334 # endif
335 #elif (#cpu(powerpc) || #machine(powerpc) \
336 || #cpu(powerpc64) || #machine(powerpc64))
337 # error
338 #endif
340 #if defined __rs6000__
341 # if !#cpu(rs6000) || !#machine(rs6000)
342 # error
343 # endif
344 #elif #cpu(rs6000) || #machine(rs6000)
345 # error
346 #endif
348 #if defined __s390__
349 # if !#cpu(s390) || !#machine(s390)
350 # error
351 # endif
352 #elif #cpu(s390) || #machine(s390)
353 # error
354 #endif
356 #if defined __sh__
357 # if !#cpu(sh) || !#machine(sh)
358 # error
359 # endif
360 #elif #cpu(sh) || #machine(sh)
361 # error
362 #endif
364 #if defined __sparc__
365 # if (defined __arch64__ \
366 && (!#cpu(sparc64) || !#machine(sparc64) || #cpu(sparc) || #machine(sparc)))
367 || (!defined __arch64__ \
368 && (#cpu(sparc64) || #machine(sparc64) || !#cpu(sparc) || !#machine(sparc)))
369 # error
370 # endif
371 #elif #cpu(sparc64) || #machine(sparc64) || #cpu(sparc) || #machine(sparc)
372 # error
373 #endif
375 #if defined __xstormy16__
376 # if !#cpu(xstormy16) || !#machine(xstormy16)
377 # error
378 # endif
379 #elif #cpu(xstormy16) || #machine(xstormy16)
380 # error
381 #endif
383 #if defined __v850__
384 # if !#cpu(v850) || !#machine(v850)
385 # error
386 # endif
387 #elif #cpu(v850) || #machine(v850)
388 # error
389 #endif
391 #if defined __vax__
392 # if !#cpu(vax) || !#machine(vax)
393 # error
394 # endif
395 #elif #cpu(vax) || #machine(vax)
396 # error
397 #endif
399 #if defined __XTENSA__
400 # if !#cpu(xtensa) || !#machine(xtensa)
401 # error
402 # endif
403 #elif #cpu(xtensa) || #machine(xtensa)
404 # error
405 #endif