OSDN Git Service

* config/gnu.h (HURD_TARGET_OS_CPP_BUILTINS): New.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / cpp / assert4.c
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 __rtems__
82 # if !#system(rtems)
83 #  error
84 # endif
85 #elif #system(rtems)
86 # error
87 #endif
88
89
90 /* Check for #cpu and #machine assertions.  */
91
92 #if defined __arc__
93 # if !#cpu(arc) || !#machine(arc)
94 #  error
95 # endif
96 #elif #cpu(arc) || #machine(arc)
97 # error
98 #endif
99
100 #if defined __alpha__
101 # if !#cpu(alpha) || !#machine(alpha) \
102         || (defined __alpha_cix__ && !#cpu(cix)) \
103         || (!defined __alpha_cix__ && #cpu(cix)) \
104         || (defined __alpha_fix__ && !#cpu(fix)) \
105         || (!defined __alpha_fix__ && #cpu(fix)) \
106         || (defined __alpha_bwx__ && !#cpu(bwx)) \
107         || (!defined __alpha_bwx__ && #cpu(bwx)) \
108         || (defined __alpha_max__ && !#cpu(max)) \
109         || (!defined __alpha_max__ && #cpu(max)) \
110         || (defined __alpha_ev6__ && !#cpu(ev6)) \
111         || (!defined __alpha_ev6__ && #cpu(ev6)) \
112         || (defined __alpha_ev5__ && !#cpu(ev5)) \
113         || (!defined __alpha_ev5__ && #cpu(ev5)) \
114         || (defined __alpha_ev4__ && !#cpu(ev4)) \
115         || (!defined __alpha_ev4__ && #cpu(ev4))
116 #  error
117 # endif
118 #elif #cpu(alpha) || #machine(alpha) || #cpu(cix) || #cpu(fix) || #cpu(bwx) \
119         || #cpu(max) || #cpu(ev6) || #cpu(ev5) || #cpu(ev4)
120 # error
121 #endif
122
123 #if defined __arm__
124 # if !#cpu(arm) || !#machine(arm)
125 #  error
126 # endif
127 #elif #cpu(arm) || #machine(arm)
128 # error
129 #endif
130
131 #if defined __cris__
132 # if !#cpu(cris) || !#machine(cris)
133 #  error
134 # endif
135 #elif #cpu(cris) || #machine(cris)
136 # error
137 #endif
138
139 #if defined __d30v__
140 # if !#cpu(d30v) || !#machine(d30v)
141 #  error
142 # endif
143 #elif #cpu(d30v) || #machine(d30v)
144 # error
145 #endif
146
147 #if defined __fr30__
148 # if !#cpu(fr30) || !#machine(fr30)
149 #  error
150 # endif
151 #elif #cpu(fr30) || #machine(fr30)
152 # error
153 #endif
154
155 #if defined __frv__
156 # if !#cpu(frv) || !#machine(frv)
157 #  error
158 # endif
159 #elif #cpu(frv) || #machine(frv)
160 # error
161 #endif
162
163 #if defined __h8300__ 
164 # if !#cpu(h8300) || !#machine(h8300) \
165   || (defined __H8300__ && (!#cpu(h8300) || !#machine(h8300))) \
166   || (defined __H8300H__ && (!#cpu(h8300h) || !#machine(h8300h))) \
167   || (!defined __H8300H__ && (#cpu(h8300h) || #machine(h8300h))) \
168   || (defined __H8300S__ && (!#cpu(h8300s) || !#machine(h8300s))) \
169   || (!defined __H8300S__ && (#cpu(h8300s) || #machine(h8300s)))
170 #  error
171 # endif
172 #elif #cpu(h8300) || #machine(h8300) || #cpu(h8300h) || #machine(h8300h) || \
173   #cpu(h8300s) || #machine(h8300s)
174 # error
175 #endif
176
177 #if defined __hppa__
178 # if !#cpu(hppa) || !#machine(hppa)
179 #  error
180 # endif
181 #elif #cpu(hppa) || #machine(hppa)
182 # error
183 #endif
184
185 #if defined __i370__
186 # if !#cpu(i370) || !#machine(i370)
187 #  error
188 # endif
189 #elif #cpu(i370) || #machine(i370)
190 # error
191 #endif
192
193 #if defined __x86_64__
194 # if !#cpu(x86_64) || !#machine(x86_64)
195 #  error
196 # endif
197 #elif #cpu(x86_64) || #machine(x86_64)
198 # error
199 #endif
200
201 #if defined __i386__
202 # if !#cpu(i386) || !#machine(i386)
203 #  error
204 # endif
205 #elif #cpu(i386) || #machine(i386)
206 # error
207 #endif
208
209 #if defined __i860__
210 # if !#cpu(i860) || !#machine(i860)
211 #  error
212 # endif
213 #elif #cpu(i860) || #machine(i860)
214 # error
215 #endif
216
217 #if defined __i960__
218 # if !#cpu(i960) || !#machine(i960)
219 #  error
220 # endif
221 #elif #cpu(i960) || #machine(i960)
222 # error
223 #endif
224
225 #if defined __ia64__
226 # if !#cpu(ia64) || !#machine(ia64)
227 #  error
228 # endif
229 #elif #cpu(ia64) || #machine(ia64)
230 # error
231 #endif
232
233 #if defined __iq2000__
234 # if !#cpu(iq2000) || !#machine(iq2000)
235 #  error
236 # endif
237 #elif #cpu(iq2000) || #machine(iq2000)
238 # error
239 #endif
240
241 #if defined __M32R__
242 # if !#cpu(m32r) || !#machine(m32r)
243 #  error
244 # endif
245 #elif #cpu(m32r) || #machine(m32r)
246 # error
247 #endif
248
249 #if defined __m68k__
250 # if !#cpu(m68k) || !#machine(m68k)
251 #  error
252 # endif
253 #elif #cpu(m68k) || #machine(m68k)
254 # error
255 #endif
256
257 #if defined __mcore__
258 # if !#cpu(mcore) || !#machine(mcore)
259 #  error
260 # endif
261 #elif #cpu(mcore) || #machine(mcore)
262 # error
263 #endif
264
265 #if defined __mips__
266 # if !#cpu(mips) || (defined __sgi__ && !#machine(sgi)) \
267   || (!defined __sgi__ && !#machine(mips))
268 #  error
269 # endif
270 #elif #cpu(mips) || #machine(sgi) || #machine(mips)
271 # error
272 #endif
273
274 #if defined __mmix__
275 # if !#cpu(mmix) || !#machine(mmix)
276 #  error
277 # endif
278 #elif #cpu(mmix) || #machine(mcore)
279 # error
280 #endif
281
282 #if defined __mn10300__
283 # if !#cpu(mn10300) || !#machine(mn10300)
284 #  error
285 # endif
286 #elif #cpu(mn10300) || #machine(mn10300)
287 # error
288 #endif
289
290 #if defined __ns32k__
291 # if !#cpu(ns32k) || !#machine(ns32k)
292 #  error
293 # endif
294 #elif #cpu(ns32k) || #machine(ns32k)
295 # error
296 #endif
297
298 #if defined __pdp11__
299 # if !#cpu(pdp11) || !#machine(pdp11)
300 #  error
301 # endif
302 #elif #cpu(pdp11) || #machine(pdp11)
303 # error
304 #endif
305
306 #if defined __powerpc__
307 # if !#cpu(powerpc) || !#machine(powerpc)
308 #  error
309 # endif
310 #elif #cpu(powerpc) || #machine(powerpc)
311 # error
312 #endif
313
314 #if defined __rs6000__
315 # if !#cpu(rs6000) || !#machine(rs6000)
316 #  error
317 # endif
318 #elif #cpu(rs6000) || #machine(rs6000)
319 # error
320 #endif
321
322 #if defined __s390__
323 # if !#cpu(s390) || !#machine(s390)
324 #  error
325 # endif
326 #elif #cpu(s390) || #machine(s390)
327 # error
328 #endif
329
330 #if defined __sh__
331 # if !#cpu(sh) || !#machine(sh)
332 #  error
333 # endif
334 #elif #cpu(sh) || #machine(sh)
335 # error
336 #endif
337
338 #if defined __sparc__
339 # if (defined __arch64__ \
340       && (!#cpu(sparc64) || !#machine(sparc64) || #cpu(sparc) || #machine(sparc)))
341   || (!defined __arch64__ \
342       && (#cpu(sparc64) || #machine(sparc64) || !#cpu(sparc) || !#machine(sparc)))
343 #  error
344 # endif
345 #elif #cpu(sparc64) || #machine(sparc64) || #cpu(sparc) || #machine(sparc)
346 # error
347 #endif
348
349 #if defined __xstormy16__
350 # if !#cpu(xstormy16) || !#machine(xstormy16)
351 #  error
352 # endif
353 #elif #cpu(xstormy16) || #machine(xstormy16)
354 # error
355 #endif
356
357 #if defined __v850__
358 # if !#cpu(v850) || !#machine(v850)
359 #  error
360 # endif
361 #elif #cpu(v850) || #machine(v850)
362 # error
363 #endif
364
365 #if defined __vax__
366 # if !#cpu(vax) || !#machine(vax)
367 #  error
368 # endif
369 #elif #cpu(vax) || #machine(vax)
370 # error
371 #endif
372
373 #if defined __XTENSA__
374 # if !#cpu(xtensa) || !#machine(xtensa)
375 #  error
376 # endif
377 #elif #cpu(xtensa) || #machine(xtensa)
378 # error
379 #endif
380