OSDN Git Service

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