libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / builtin-stdc-bit-1.c
blob6ba95ad3a47adf2667c1cb99dd276e85677cfe6f
1 /* { dg-do run } */
2 /* { dg-options "-std=c11" } */
4 unsigned int
5 leading_zeros (unsigned char a, unsigned short b, unsigned int c,
6 unsigned long d, unsigned long long e)
8 return (__builtin_stdc_leading_zeros (a)
9 + __builtin_stdc_leading_zeros (b)
10 + __builtin_stdc_leading_zeros (c)
11 + __builtin_stdc_leading_zeros (d)
12 + __builtin_stdc_leading_zeros (e));
15 unsigned int
16 leading_ones (unsigned char a, unsigned short b, unsigned int c,
17 unsigned long d, unsigned long long e)
19 return (__builtin_stdc_leading_ones (a)
20 + __builtin_stdc_leading_ones (b)
21 + __builtin_stdc_leading_ones (c)
22 + __builtin_stdc_leading_ones (d)
23 + __builtin_stdc_leading_ones (e));
26 unsigned int
27 trailing_zeros (unsigned char a, unsigned short b, unsigned int c,
28 unsigned long d, unsigned long long e)
30 return (__builtin_stdc_trailing_zeros (a)
31 + __builtin_stdc_trailing_zeros (b)
32 + __builtin_stdc_trailing_zeros (c)
33 + __builtin_stdc_trailing_zeros (d)
34 + __builtin_stdc_trailing_zeros (e));
37 unsigned int
38 trailing_ones (unsigned char a, unsigned short b, unsigned int c,
39 unsigned long d, unsigned long long e)
41 return (__builtin_stdc_trailing_ones (a)
42 + __builtin_stdc_trailing_ones (b)
43 + __builtin_stdc_trailing_ones (c)
44 + __builtin_stdc_trailing_ones (d)
45 + __builtin_stdc_trailing_ones (e));
48 unsigned int
49 first_leading_zero (unsigned char a, unsigned short b, unsigned int c,
50 unsigned long d, unsigned long long e)
52 return (__builtin_stdc_first_leading_zero (a)
53 + __builtin_stdc_first_leading_zero (b)
54 + __builtin_stdc_first_leading_zero (c)
55 + __builtin_stdc_first_leading_zero (d)
56 + __builtin_stdc_first_leading_zero (e));
59 unsigned int
60 first_leading_one (unsigned char a, unsigned short b, unsigned int c,
61 unsigned long d, unsigned long long e)
63 return (__builtin_stdc_first_leading_one (a)
64 + __builtin_stdc_first_leading_one (b)
65 + __builtin_stdc_first_leading_one (c)
66 + __builtin_stdc_first_leading_one (d)
67 + __builtin_stdc_first_leading_one (e));
70 unsigned int
71 first_trailing_zero (unsigned char a, unsigned short b, unsigned int c,
72 unsigned long d, unsigned long long e)
74 return (__builtin_stdc_first_trailing_zero (a)
75 + __builtin_stdc_first_trailing_zero (b)
76 + __builtin_stdc_first_trailing_zero (c)
77 + __builtin_stdc_first_trailing_zero (d)
78 + __builtin_stdc_first_trailing_zero (e));
81 unsigned int
82 first_trailing_one (unsigned char a, unsigned short b, unsigned int c,
83 unsigned long d, unsigned long long e)
85 return (__builtin_stdc_first_trailing_one (a)
86 + __builtin_stdc_first_trailing_one (b)
87 + __builtin_stdc_first_trailing_one (c)
88 + __builtin_stdc_first_trailing_one (d)
89 + __builtin_stdc_first_trailing_one (e));
92 unsigned int
93 count_zeros (unsigned char a, unsigned short b, unsigned int c,
94 unsigned long d, unsigned long long e)
96 return (__builtin_stdc_count_zeros (a)
97 + __builtin_stdc_count_zeros (b)
98 + __builtin_stdc_count_zeros (c)
99 + __builtin_stdc_count_zeros (d)
100 + __builtin_stdc_count_zeros (e));
103 unsigned int
104 count_ones (unsigned char a, unsigned short b, unsigned int c,
105 unsigned long d, unsigned long long e)
107 return (__builtin_stdc_count_ones (a)
108 + __builtin_stdc_count_ones (b)
109 + __builtin_stdc_count_ones (c)
110 + __builtin_stdc_count_ones (d)
111 + __builtin_stdc_count_ones (e));
114 unsigned int
115 has_single_bit (unsigned char a, unsigned short b, unsigned int c,
116 unsigned long d, unsigned long long e)
118 return (__builtin_stdc_has_single_bit (a)
119 || __builtin_stdc_has_single_bit (b)
120 || __builtin_stdc_has_single_bit (c)
121 || __builtin_stdc_has_single_bit (d)
122 || __builtin_stdc_has_single_bit (e));
125 unsigned int
126 bit_width (unsigned char a, unsigned short b, unsigned int c,
127 unsigned long d, unsigned long long e)
129 return (__builtin_stdc_bit_width (a)
130 + __builtin_stdc_bit_width (b)
131 + __builtin_stdc_bit_width (c)
132 + __builtin_stdc_bit_width (d)
133 + __builtin_stdc_bit_width (e));
136 unsigned long long
137 bit_floor (unsigned char a, unsigned short b, unsigned int c,
138 unsigned long d, unsigned long long e)
140 return (__builtin_stdc_bit_floor (a)
141 + __builtin_stdc_bit_floor (b)
142 + __builtin_stdc_bit_floor (c)
143 + __builtin_stdc_bit_floor (d)
144 + __builtin_stdc_bit_floor (e));
147 unsigned long long
148 bit_ceil (unsigned char a, unsigned short b, unsigned int c,
149 unsigned long d, unsigned long long e)
151 return (__builtin_stdc_bit_ceil (a)
152 + __builtin_stdc_bit_ceil (b)
153 + __builtin_stdc_bit_ceil (c)
154 + __builtin_stdc_bit_ceil (d)
155 + __builtin_stdc_bit_ceil (e));
158 #define expr_has_type(e, t) _Generic (e, default : 0, t : 1)
161 main ()
163 if (__builtin_stdc_leading_zeros ((unsigned char) 0) != __CHAR_BIT__
164 || !expr_has_type (__builtin_stdc_leading_zeros ((unsigned char) 0), unsigned int)
165 || __builtin_stdc_leading_zeros ((unsigned short) 0) != __SIZEOF_SHORT__ * __CHAR_BIT__
166 || !expr_has_type (__builtin_stdc_leading_zeros ((unsigned short) 0), unsigned int)
167 || __builtin_stdc_leading_zeros (0U) != __SIZEOF_INT__ * __CHAR_BIT__
168 || !expr_has_type (__builtin_stdc_leading_zeros (0U), unsigned int)
169 || __builtin_stdc_leading_zeros (0UL) != __SIZEOF_LONG__ * __CHAR_BIT__
170 || !expr_has_type (__builtin_stdc_leading_zeros (0UL), unsigned int)
171 || __builtin_stdc_leading_zeros (0ULL) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__
172 || !expr_has_type (__builtin_stdc_leading_zeros (0ULL), unsigned int))
173 __builtin_abort ();
174 if (__builtin_stdc_leading_zeros ((unsigned char) ~0U) != 0
175 || __builtin_stdc_leading_zeros ((unsigned short) ~0U) != 0
176 || __builtin_stdc_leading_zeros (~0U) != 0
177 || __builtin_stdc_leading_zeros (~0UL) != 0
178 || __builtin_stdc_leading_zeros (~0ULL) != 0)
179 __builtin_abort ();
180 if (__builtin_stdc_leading_zeros ((unsigned char) 3) != __CHAR_BIT__ - 2
181 || __builtin_stdc_leading_zeros ((unsigned short) 9) != __SIZEOF_SHORT__ * __CHAR_BIT__ - 4
182 || __builtin_stdc_leading_zeros (34U) != __SIZEOF_INT__ * __CHAR_BIT__ - 6
183 || __builtin_stdc_leading_zeros (130UL) != __SIZEOF_LONG__ * __CHAR_BIT__ - 8
184 || __builtin_stdc_leading_zeros (512ULL) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 10)
185 __builtin_abort ();
186 if (__builtin_stdc_leading_ones ((unsigned char) 0) != 0
187 || !expr_has_type (__builtin_stdc_leading_ones ((unsigned char) 0), unsigned int)
188 || __builtin_stdc_leading_ones ((unsigned short) 0) != 0
189 || !expr_has_type (__builtin_stdc_leading_ones ((unsigned short) 0), unsigned int)
190 || __builtin_stdc_leading_ones (0U) != 0
191 || !expr_has_type (__builtin_stdc_leading_ones (0U), unsigned int)
192 || __builtin_stdc_leading_ones (0UL) != 0
193 || !expr_has_type (__builtin_stdc_leading_ones (0UL), unsigned int)
194 || __builtin_stdc_leading_ones (0ULL) != 0
195 || !expr_has_type (__builtin_stdc_leading_ones (0ULL), unsigned int))
196 __builtin_abort ();
197 if (__builtin_stdc_leading_ones ((unsigned char) ~0U) != __CHAR_BIT__
198 || __builtin_stdc_leading_ones ((unsigned short) ~0U) != __SIZEOF_SHORT__ * __CHAR_BIT__
199 || __builtin_stdc_leading_ones (~0U) != __SIZEOF_INT__ * __CHAR_BIT__
200 || __builtin_stdc_leading_ones (~0UL) != __SIZEOF_LONG__ * __CHAR_BIT__
201 || __builtin_stdc_leading_ones (~0ULL) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__)
202 __builtin_abort ();
203 if (__builtin_stdc_leading_ones ((unsigned char) ~3) != __CHAR_BIT__ - 2
204 || __builtin_stdc_leading_ones ((unsigned short) ~9) != __SIZEOF_SHORT__ * __CHAR_BIT__ - 4
205 || __builtin_stdc_leading_ones (~34U) != __SIZEOF_INT__ * __CHAR_BIT__ - 6
206 || __builtin_stdc_leading_ones (~130UL) != __SIZEOF_LONG__ * __CHAR_BIT__ - 8
207 || __builtin_stdc_leading_ones (~512ULL) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 10)
208 __builtin_abort ();
209 if (__builtin_stdc_trailing_zeros ((unsigned char) 0) != __CHAR_BIT__
210 || !expr_has_type (__builtin_stdc_trailing_zeros ((unsigned char) 0), unsigned int)
211 || __builtin_stdc_trailing_zeros ((unsigned short) 0) != __SIZEOF_SHORT__ * __CHAR_BIT__
212 || !expr_has_type (__builtin_stdc_trailing_zeros ((unsigned short) 0), unsigned int)
213 || __builtin_stdc_trailing_zeros (0U) != __SIZEOF_INT__ * __CHAR_BIT__
214 || !expr_has_type (__builtin_stdc_trailing_zeros (0U), unsigned int)
215 || __builtin_stdc_trailing_zeros (0UL) != __SIZEOF_LONG__ * __CHAR_BIT__
216 || !expr_has_type (__builtin_stdc_trailing_zeros (0UL), unsigned int)
217 || __builtin_stdc_trailing_zeros (0ULL) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__
218 || !expr_has_type (__builtin_stdc_trailing_zeros (0ULL), unsigned int))
219 __builtin_abort ();
220 if (__builtin_stdc_trailing_zeros ((unsigned char) ~0U) != 0
221 || __builtin_stdc_trailing_zeros ((unsigned short) ~0U) != 0
222 || __builtin_stdc_trailing_zeros (~0U) != 0
223 || __builtin_stdc_trailing_zeros (~0UL) != 0
224 || __builtin_stdc_trailing_zeros (~0ULL) != 0)
225 __builtin_abort ();
226 if (__builtin_stdc_trailing_zeros ((unsigned char) 2) != 1
227 || __builtin_stdc_trailing_zeros ((unsigned short) 24) != 3
228 || __builtin_stdc_trailing_zeros (32U) != 5
229 || __builtin_stdc_trailing_zeros (128UL) != 7
230 || __builtin_stdc_trailing_zeros (512ULL) != 9)
231 __builtin_abort ();
232 if (__builtin_stdc_trailing_ones ((unsigned char) 0) != 0
233 || !expr_has_type (__builtin_stdc_trailing_ones ((unsigned char) 0), unsigned int)
234 || __builtin_stdc_trailing_ones ((unsigned short) 0) != 0
235 || !expr_has_type (__builtin_stdc_trailing_ones ((unsigned short) 0), unsigned int)
236 || __builtin_stdc_trailing_ones (0U) != 0
237 || !expr_has_type (__builtin_stdc_trailing_ones (0U), unsigned int)
238 || __builtin_stdc_trailing_ones (0UL) != 0
239 || !expr_has_type (__builtin_stdc_trailing_ones (0UL), unsigned int)
240 || __builtin_stdc_trailing_ones (0ULL) != 0
241 || !expr_has_type (__builtin_stdc_trailing_ones (0ULL), unsigned int))
242 __builtin_abort ();
243 if (__builtin_stdc_trailing_ones ((unsigned char) ~0U) != __CHAR_BIT__
244 || __builtin_stdc_trailing_ones ((unsigned short) ~0U) != __SIZEOF_SHORT__ * __CHAR_BIT__
245 || __builtin_stdc_trailing_ones (~0U) != __SIZEOF_INT__ * __CHAR_BIT__
246 || __builtin_stdc_trailing_ones (~0UL) != __SIZEOF_LONG__ * __CHAR_BIT__
247 || __builtin_stdc_trailing_ones (~0ULL) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__)
248 __builtin_abort ();
249 if (__builtin_stdc_trailing_ones ((unsigned char) 5) != 1
250 || __builtin_stdc_trailing_ones ((unsigned short) 15) != 4
251 || __builtin_stdc_trailing_ones (127U) != 7
252 || __builtin_stdc_trailing_ones (511UL) != 9
253 || __builtin_stdc_trailing_ones (~0ULL >> 2) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 2)
254 __builtin_abort ();
255 if (__builtin_stdc_first_leading_zero ((unsigned char) 0) != 1
256 || !expr_has_type (__builtin_stdc_first_leading_zero ((unsigned char) 0), unsigned int)
257 || __builtin_stdc_first_leading_zero ((unsigned short) 0) != 1
258 || !expr_has_type (__builtin_stdc_first_leading_zero ((unsigned short) 0), unsigned int)
259 || __builtin_stdc_first_leading_zero (0U) != 1
260 || !expr_has_type (__builtin_stdc_first_leading_zero (0U), unsigned int)
261 || __builtin_stdc_first_leading_zero (0UL) != 1
262 || !expr_has_type (__builtin_stdc_first_leading_zero (0UL), unsigned int)
263 || __builtin_stdc_first_leading_zero (0ULL) != 1
264 || !expr_has_type (__builtin_stdc_first_leading_zero (0ULL), unsigned int))
265 __builtin_abort ();
266 if (__builtin_stdc_first_leading_zero ((unsigned char) ~0U) != 0
267 || __builtin_stdc_first_leading_zero ((unsigned short) ~0U) != 0
268 || __builtin_stdc_first_leading_zero (~0U) != 0
269 || __builtin_stdc_first_leading_zero (~0UL) != 0
270 || __builtin_stdc_first_leading_zero (~0ULL) != 0)
271 __builtin_abort ();
272 if (__builtin_stdc_first_leading_zero ((unsigned char) ~3U) != __CHAR_BIT__ - 1
273 || __builtin_stdc_first_leading_zero ((unsigned short) ~15U) != __SIZEOF_SHORT__ * __CHAR_BIT__ - 3
274 || __builtin_stdc_first_leading_zero (~63U) != __SIZEOF_INT__ * __CHAR_BIT__ - 5
275 || __builtin_stdc_first_leading_zero (~255UL) != __SIZEOF_LONG__ * __CHAR_BIT__ - 7
276 || __builtin_stdc_first_leading_zero (~1023ULL) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 9)
277 __builtin_abort ();
278 if (__builtin_stdc_first_leading_one ((unsigned char) 0) != 0
279 || !expr_has_type (__builtin_stdc_first_leading_one ((unsigned char) 0), unsigned int)
280 || __builtin_stdc_first_leading_one ((unsigned short) 0) != 0
281 || !expr_has_type (__builtin_stdc_first_leading_one ((unsigned short) 0), unsigned int)
282 || __builtin_stdc_first_leading_one (0U) != 0
283 || !expr_has_type (__builtin_stdc_first_leading_one (0U), unsigned int)
284 || __builtin_stdc_first_leading_one (0UL) != 0
285 || !expr_has_type (__builtin_stdc_first_leading_one (0UL), unsigned int)
286 || __builtin_stdc_first_leading_one (0ULL) != 0
287 || !expr_has_type (__builtin_stdc_first_leading_one (0ULL), unsigned int))
288 __builtin_abort ();
289 if (__builtin_stdc_first_leading_one ((unsigned char) ~0U) != 1
290 || __builtin_stdc_first_leading_one ((unsigned short) ~0U) != 1
291 || __builtin_stdc_first_leading_one (~0U) != 1
292 || __builtin_stdc_first_leading_one (~0UL) != 1
293 || __builtin_stdc_first_leading_one (~0ULL) != 1)
294 __builtin_abort ();
295 if (__builtin_stdc_first_leading_one ((unsigned char) 3) != __CHAR_BIT__ - 1
296 || __builtin_stdc_first_leading_one ((unsigned short) 9) != __SIZEOF_SHORT__ * __CHAR_BIT__ - 3
297 || __builtin_stdc_first_leading_one (34U) != __SIZEOF_INT__ * __CHAR_BIT__ - 5
298 || __builtin_stdc_first_leading_one (130UL) != __SIZEOF_LONG__ * __CHAR_BIT__ - 7
299 || __builtin_stdc_first_leading_one (512ULL) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 9)
300 __builtin_abort ();
301 if (__builtin_stdc_first_trailing_zero ((unsigned char) 0) != 1
302 || !expr_has_type (__builtin_stdc_first_trailing_zero ((unsigned char) 0), unsigned int)
303 || __builtin_stdc_first_trailing_zero ((unsigned short) 0) != 1
304 || !expr_has_type (__builtin_stdc_first_trailing_zero ((unsigned short) 0), unsigned int)
305 || __builtin_stdc_first_trailing_zero (0U) != 1
306 || !expr_has_type (__builtin_stdc_first_trailing_zero (0U), unsigned int)
307 || __builtin_stdc_first_trailing_zero (0UL) != 1
308 || !expr_has_type (__builtin_stdc_first_trailing_zero (0UL), unsigned int)
309 || __builtin_stdc_first_trailing_zero (0ULL) != 1
310 || !expr_has_type (__builtin_stdc_first_trailing_zero (0ULL), unsigned int))
311 __builtin_abort ();
312 if (__builtin_stdc_first_trailing_zero ((unsigned char) ~0U) != 0
313 || __builtin_stdc_first_trailing_zero ((unsigned short) ~0U) != 0
314 || __builtin_stdc_first_trailing_zero (~0U) != 0
315 || __builtin_stdc_first_trailing_zero (~0UL) != 0
316 || __builtin_stdc_first_trailing_zero (~0ULL) != 0)
317 __builtin_abort ();
318 if (__builtin_stdc_first_trailing_zero ((unsigned char) 2) != 1
319 || __builtin_stdc_first_trailing_zero ((unsigned short) 15) != 5
320 || __builtin_stdc_first_trailing_zero (63U) != 7
321 || __builtin_stdc_first_trailing_zero (128UL) != 1
322 || __builtin_stdc_first_trailing_zero (511ULL) != 10)
323 __builtin_abort ();
324 if (__builtin_stdc_first_trailing_one ((unsigned char) 0) != 0
325 || !expr_has_type (__builtin_stdc_first_trailing_one ((unsigned char) 0), unsigned int)
326 || __builtin_stdc_first_trailing_one ((unsigned short) 0) != 0
327 || !expr_has_type (__builtin_stdc_first_trailing_one ((unsigned short) 0), unsigned int)
328 || __builtin_stdc_first_trailing_one (0U) != 0
329 || !expr_has_type (__builtin_stdc_first_trailing_one (0U), unsigned int)
330 || __builtin_stdc_first_trailing_one (0UL) != 0
331 || !expr_has_type (__builtin_stdc_first_trailing_one (0UL), unsigned int)
332 || __builtin_stdc_first_trailing_one (0ULL) != 0
333 || !expr_has_type (__builtin_stdc_first_trailing_one (0ULL), unsigned int))
334 __builtin_abort ();
335 if (__builtin_stdc_first_trailing_one ((unsigned char) ~0U) != 1
336 || __builtin_stdc_first_trailing_one ((unsigned short) ~0U) != 1
337 || __builtin_stdc_first_trailing_one (~0U) != 1
338 || __builtin_stdc_first_trailing_one (~0UL) != 1
339 || __builtin_stdc_first_trailing_one (~0ULL) != 1)
340 __builtin_abort ();
341 if (__builtin_stdc_first_trailing_one ((unsigned char) 4) != 3
342 || __builtin_stdc_first_trailing_one ((unsigned short) 96) != 6
343 || __builtin_stdc_first_trailing_one (127U) != 1
344 || __builtin_stdc_first_trailing_one (511UL) != 1
345 || __builtin_stdc_first_trailing_one (~0ULL << 12) != 13)
346 __builtin_abort ();
347 if (__builtin_stdc_count_zeros ((unsigned char) 0) != __CHAR_BIT__
348 || !expr_has_type (__builtin_stdc_count_zeros ((unsigned char) 0), unsigned int)
349 || __builtin_stdc_count_zeros ((unsigned short) 0) != __SIZEOF_SHORT__ * __CHAR_BIT__
350 || !expr_has_type (__builtin_stdc_count_zeros ((unsigned short) 0), unsigned int)
351 || __builtin_stdc_count_zeros (0U) != __SIZEOF_INT__ * __CHAR_BIT__
352 || !expr_has_type (__builtin_stdc_count_zeros (0U), unsigned int)
353 || __builtin_stdc_count_zeros (0UL) != __SIZEOF_LONG__ * __CHAR_BIT__
354 || !expr_has_type (__builtin_stdc_count_zeros (0UL), unsigned int)
355 || __builtin_stdc_count_zeros (0ULL) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__
356 || !expr_has_type (__builtin_stdc_count_zeros (0ULL), unsigned int))
357 __builtin_abort ();
358 if (__builtin_stdc_count_zeros ((unsigned char) ~0U) != 0
359 || __builtin_stdc_count_zeros ((unsigned short) ~0U) != 0
360 || __builtin_stdc_count_zeros (~0U) != 0
361 || __builtin_stdc_count_zeros (~0UL) != 0
362 || __builtin_stdc_count_zeros (~0ULL) != 0)
363 __builtin_abort ();
364 if (__builtin_stdc_count_zeros ((unsigned char) 1U) != __CHAR_BIT__ - 1
365 || __builtin_stdc_count_zeros ((unsigned short) 42) != __SIZEOF_SHORT__ * __CHAR_BIT__ - 3
366 || __builtin_stdc_count_zeros (291U) != __SIZEOF_INT__ * __CHAR_BIT__ - 4
367 || __builtin_stdc_count_zeros (~1315UL) != 5
368 || __builtin_stdc_count_zeros (3363ULL) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 6)
369 __builtin_abort ();
370 if (__builtin_stdc_count_ones ((unsigned char) 0) != 0
371 || !expr_has_type (__builtin_stdc_count_ones ((unsigned char) 0), unsigned int)
372 || __builtin_stdc_count_ones ((unsigned short) 0) != 0
373 || !expr_has_type (__builtin_stdc_count_ones ((unsigned short) 0), unsigned int)
374 || __builtin_stdc_count_ones (0U) != 0
375 || !expr_has_type (__builtin_stdc_count_ones (0U), unsigned int)
376 || __builtin_stdc_count_ones (0UL) != 0
377 || !expr_has_type (__builtin_stdc_count_ones (0UL), unsigned int)
378 || __builtin_stdc_count_ones (0ULL) != 0
379 || !expr_has_type (__builtin_stdc_count_ones (0ULL), unsigned int))
380 __builtin_abort ();
381 if (__builtin_stdc_count_ones ((unsigned char) ~0U) != __CHAR_BIT__
382 || __builtin_stdc_count_ones ((unsigned short) ~0U) != __SIZEOF_SHORT__ * __CHAR_BIT__
383 || __builtin_stdc_count_ones (~0U) != __SIZEOF_INT__ * __CHAR_BIT__
384 || __builtin_stdc_count_ones (~0UL) != __SIZEOF_LONG__ * __CHAR_BIT__
385 || __builtin_stdc_count_ones (~0ULL) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__)
386 __builtin_abort ();
387 if (__builtin_stdc_count_ones ((unsigned char) ~1U) != __CHAR_BIT__ - 1
388 || __builtin_stdc_count_ones ((unsigned short) ~42) != __SIZEOF_SHORT__ * __CHAR_BIT__ - 3
389 || __builtin_stdc_count_ones (~291U) != __SIZEOF_INT__ * __CHAR_BIT__ - 4
390 || __builtin_stdc_count_ones (1315UL) != 5
391 || __builtin_stdc_count_ones (~3363ULL) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 6)
392 __builtin_abort ();
393 if (__builtin_stdc_has_single_bit ((unsigned char) 0)
394 || !expr_has_type (__builtin_stdc_has_single_bit ((unsigned char) 0), _Bool)
395 || __builtin_stdc_has_single_bit ((unsigned short) 0)
396 || !expr_has_type (__builtin_stdc_has_single_bit ((unsigned short) 0), _Bool)
397 || __builtin_stdc_has_single_bit (0U)
398 || !expr_has_type (__builtin_stdc_has_single_bit (0U), _Bool)
399 || __builtin_stdc_has_single_bit (0UL)
400 || !expr_has_type (__builtin_stdc_has_single_bit (0UL), _Bool)
401 || __builtin_stdc_has_single_bit (0ULL)
402 || !expr_has_type (__builtin_stdc_has_single_bit (0ULL), _Bool))
403 __builtin_abort ();
404 if (!__builtin_stdc_has_single_bit ((unsigned char) 2)
405 || !__builtin_stdc_has_single_bit ((unsigned short) 8)
406 || !__builtin_stdc_has_single_bit (32U)
407 || !__builtin_stdc_has_single_bit (128UL)
408 || !__builtin_stdc_has_single_bit (512ULL))
409 __builtin_abort ();
410 if (__builtin_stdc_has_single_bit ((unsigned char) 7)
411 || __builtin_stdc_has_single_bit ((unsigned short) 96)
412 || __builtin_stdc_has_single_bit (513U)
413 || __builtin_stdc_has_single_bit (1022UL)
414 || __builtin_stdc_has_single_bit (12ULL))
415 __builtin_abort ();
416 if (__builtin_stdc_bit_width ((unsigned char) 0) != 0
417 || !expr_has_type (__builtin_stdc_bit_width ((unsigned char) 0), unsigned int)
418 || __builtin_stdc_bit_width ((unsigned short) 0) != 0
419 || !expr_has_type (__builtin_stdc_bit_width ((unsigned short) 0), unsigned int)
420 || __builtin_stdc_bit_width (0U) != 0
421 || !expr_has_type (__builtin_stdc_bit_width (0U), unsigned int)
422 || __builtin_stdc_bit_width (0UL) != 0
423 || !expr_has_type (__builtin_stdc_bit_width (0UL), unsigned int)
424 || __builtin_stdc_bit_width (0ULL) != 0
425 || !expr_has_type (__builtin_stdc_bit_width (0ULL), unsigned int))
426 __builtin_abort ();
427 if (__builtin_stdc_bit_width ((unsigned char) ~0U) != __CHAR_BIT__
428 || __builtin_stdc_bit_width ((unsigned short) ~0U) != __SIZEOF_SHORT__ * __CHAR_BIT__
429 || __builtin_stdc_bit_width (~0U) != __SIZEOF_INT__ * __CHAR_BIT__
430 || __builtin_stdc_bit_width (~0UL) != __SIZEOF_LONG__ * __CHAR_BIT__
431 || __builtin_stdc_bit_width (~0ULL) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__)
432 __builtin_abort ();
433 if (__builtin_stdc_bit_width ((unsigned char) ((unsigned char) ~0U >> 1)) != __CHAR_BIT__ - 1
434 || __builtin_stdc_bit_width ((unsigned char) 6) != 3
435 || __builtin_stdc_bit_width ((unsigned short) 12U) != 4
436 || __builtin_stdc_bit_width ((unsigned short) ((unsigned short) ~0U >> 5)) != __SIZEOF_SHORT__ * __CHAR_BIT__ - 5
437 || __builtin_stdc_bit_width (137U) != 8
438 || __builtin_stdc_bit_width (269U) != 9
439 || __builtin_stdc_bit_width (39UL) != 6
440 || __builtin_stdc_bit_width (~0UL >> 2) != __SIZEOF_LONG__ * __CHAR_BIT__ - 2
441 || __builtin_stdc_bit_width (1023ULL) != 10
442 || __builtin_stdc_bit_width (1024ULL) != 11)
443 __builtin_abort ();
444 if (__builtin_stdc_bit_floor ((unsigned char) 0) != 0
445 || !expr_has_type (__builtin_stdc_bit_floor ((unsigned char) 0), unsigned char)
446 || __builtin_stdc_bit_floor ((unsigned short) 0) != 0
447 || !expr_has_type (__builtin_stdc_bit_floor ((unsigned short) 0), unsigned short)
448 || __builtin_stdc_bit_floor (0U) != 0U
449 || !expr_has_type (__builtin_stdc_bit_floor (0U), unsigned int)
450 || __builtin_stdc_bit_floor (0UL) != 0UL
451 || !expr_has_type (__builtin_stdc_bit_floor (0UL), unsigned long)
452 || __builtin_stdc_bit_floor (0ULL) != 0ULL
453 || !expr_has_type (__builtin_stdc_bit_floor (0ULL), unsigned long long))
454 __builtin_abort ();
455 if (__builtin_stdc_bit_floor ((unsigned char) ~0U) != (1U << (__CHAR_BIT__ - 1))
456 || __builtin_stdc_bit_floor ((unsigned short) ~0U) != (1U << (__SIZEOF_SHORT__ * __CHAR_BIT__ - 1))
457 || __builtin_stdc_bit_floor (~0U) != (1U << (__SIZEOF_INT__ * __CHAR_BIT__ - 1))
458 || __builtin_stdc_bit_floor (~0UL) != (1UL << (__SIZEOF_LONG__ * __CHAR_BIT__ - 1))
459 || __builtin_stdc_bit_floor (~0ULL) != (1ULL << (__SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 1)))
460 __builtin_abort ();
461 if (__builtin_stdc_bit_floor ((unsigned char) 4) != 4
462 || __builtin_stdc_bit_floor ((unsigned char) 7) != 4
463 || __builtin_stdc_bit_floor ((unsigned short) 8U) != 8
464 || __builtin_stdc_bit_floor ((unsigned short) 31U) != 16
465 || __builtin_stdc_bit_floor (137U) != 128U
466 || __builtin_stdc_bit_floor (269U) != 256U
467 || __builtin_stdc_bit_floor (511UL) != 256UL
468 || __builtin_stdc_bit_floor (512UL) != 512UL
469 || __builtin_stdc_bit_floor (513UL) != 512ULL
470 || __builtin_stdc_bit_floor (1024ULL) != 1024ULL)
471 __builtin_abort ();
472 if (__builtin_stdc_bit_ceil ((unsigned char) 0) != 1
473 || !expr_has_type (__builtin_stdc_bit_ceil ((unsigned char) 0), unsigned char)
474 || __builtin_stdc_bit_ceil ((unsigned short) 0) != 1
475 || !expr_has_type (__builtin_stdc_bit_ceil ((unsigned short) 0), unsigned short)
476 || __builtin_stdc_bit_ceil (0U) != 1U
477 || !expr_has_type (__builtin_stdc_bit_ceil (0U), unsigned int)
478 || __builtin_stdc_bit_ceil (0UL) != 1UL
479 || !expr_has_type (__builtin_stdc_bit_ceil (0UL), unsigned long)
480 || __builtin_stdc_bit_ceil (0ULL) != 1ULL
481 || !expr_has_type (__builtin_stdc_bit_ceil (0ULL), unsigned long long))
482 __builtin_abort ();
483 if (__builtin_stdc_bit_ceil ((unsigned char) ~0U) != 0
484 || __builtin_stdc_bit_ceil ((unsigned short) ~0U) != 0
485 || __builtin_stdc_bit_ceil (~0U) != 0U
486 || __builtin_stdc_bit_ceil (~0UL) != 0UL
487 || __builtin_stdc_bit_ceil (~0ULL) != 0ULL)
488 __builtin_abort ();
489 if (__builtin_stdc_bit_ceil ((unsigned char) ((unsigned char) ~0U >> 1)) != (1U << (__CHAR_BIT__ - 1))
490 || __builtin_stdc_bit_ceil ((unsigned char) ((unsigned char) ~0U >> 1)) != (1U << (__CHAR_BIT__ - 1))
491 || __builtin_stdc_bit_ceil ((unsigned short) ((unsigned short) ~0U >> 1)) != (1U << (__SIZEOF_SHORT__ * __CHAR_BIT__ - 1))
492 || __builtin_stdc_bit_ceil ((unsigned short) ((unsigned short) ~0U >> 1)) != (1U << (__SIZEOF_SHORT__ * __CHAR_BIT__ - 1))
493 || __builtin_stdc_bit_ceil (~0U >> 1) != (1U << (__SIZEOF_INT__ * __CHAR_BIT__ - 1))
494 || __builtin_stdc_bit_ceil (1U << (__SIZEOF_INT__ * __CHAR_BIT__ - 1)) != (1U << (__SIZEOF_INT__ * __CHAR_BIT__ - 1))
495 || __builtin_stdc_bit_ceil (~0UL >> 1) != (1UL << (__SIZEOF_LONG__ * __CHAR_BIT__ - 1))
496 || __builtin_stdc_bit_ceil (~0UL >> 1) != (1UL << (__SIZEOF_LONG__ * __CHAR_BIT__ - 1))
497 || __builtin_stdc_bit_ceil (1ULL << (__SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 1)) != (1ULL << (__SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 1))
498 || __builtin_stdc_bit_ceil (~0ULL >> 1) != (1ULL << (__SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 1)))
499 __builtin_abort ();
500 if (__builtin_stdc_bit_ceil ((unsigned char) 1) != 1
501 || __builtin_stdc_bit_ceil ((unsigned char) 2) != 2
502 || __builtin_stdc_bit_ceil ((unsigned short) 3U) != 4
503 || __builtin_stdc_bit_ceil ((unsigned short) 4U) != 4
504 || __builtin_stdc_bit_ceil (5U) != 8U
505 || __builtin_stdc_bit_ceil (269U) != 512U
506 || __builtin_stdc_bit_ceil (511UL) != 512UL
507 || __builtin_stdc_bit_ceil (512UL) != 512UL
508 || __builtin_stdc_bit_ceil (513ULL) != 1024ULL
509 || __builtin_stdc_bit_ceil (1025ULL) != 2048ULL)
510 __builtin_abort ();
511 #ifdef __SIZEOF_INT128__
512 if (__builtin_stdc_leading_zeros ((unsigned __int128) 0) != __SIZEOF_INT128__ * __CHAR_BIT__
513 || !expr_has_type (__builtin_stdc_leading_zeros ((unsigned __int128) 0), unsigned int)
514 || __builtin_stdc_leading_zeros (~(unsigned __int128) 0) != 0)
515 __builtin_abort ();
516 if (__builtin_stdc_leading_ones ((unsigned __int128) 0) != 0
517 || !expr_has_type (__builtin_stdc_leading_ones ((unsigned __int128) 0), unsigned int)
518 || __builtin_stdc_leading_ones (~(unsigned __int128) 0) != __SIZEOF_INT128__ * __CHAR_BIT__)
519 __builtin_abort ();
520 if (__builtin_stdc_trailing_zeros ((unsigned __int128) 0) != __SIZEOF_INT128__ * __CHAR_BIT__
521 || !expr_has_type (__builtin_stdc_trailing_zeros ((unsigned __int128) 0), unsigned int)
522 || __builtin_stdc_trailing_zeros (~(unsigned __int128) 0) != 0)
523 __builtin_abort ();
524 if (__builtin_stdc_trailing_ones ((unsigned __int128) 0) != 0
525 || !expr_has_type (__builtin_stdc_trailing_ones ((unsigned __int128) 0), unsigned int)
526 || __builtin_stdc_trailing_ones (~(unsigned __int128) 0) != __SIZEOF_INT128__ * __CHAR_BIT__)
527 __builtin_abort ();
528 if (__builtin_stdc_first_leading_zero ((unsigned __int128) 0) != 1
529 || !expr_has_type (__builtin_stdc_first_leading_zero ((unsigned __int128) 0), unsigned int)
530 || __builtin_stdc_first_leading_zero (~(unsigned __int128) 0) != 0)
531 __builtin_abort ();
532 if (__builtin_stdc_first_leading_one ((unsigned __int128) 0) != 0
533 || !expr_has_type (__builtin_stdc_first_leading_one ((unsigned __int128) 0), unsigned int)
534 || __builtin_stdc_first_leading_one (~(unsigned __int128) 0) != 1)
535 __builtin_abort ();
536 if (__builtin_stdc_first_trailing_zero ((unsigned __int128) 0) != 1
537 || !expr_has_type (__builtin_stdc_first_trailing_zero ((unsigned __int128) 0), unsigned int)
538 || __builtin_stdc_first_trailing_zero (~(unsigned __int128) 0) != 0)
539 __builtin_abort ();
540 if (__builtin_stdc_first_trailing_one ((unsigned __int128) 0) != 0
541 || !expr_has_type (__builtin_stdc_first_trailing_one ((unsigned __int128) 0), unsigned int)
542 || __builtin_stdc_first_trailing_one (~(unsigned __int128) 0) != 1)
543 __builtin_abort ();
544 if (__builtin_stdc_count_zeros ((unsigned __int128) 0) != __SIZEOF_INT128__ * __CHAR_BIT__
545 || !expr_has_type (__builtin_stdc_count_zeros ((unsigned __int128) 0), unsigned int)
546 || __builtin_stdc_count_zeros (~(unsigned __int128) 0) != 0)
547 __builtin_abort ();
548 if (__builtin_stdc_count_ones ((unsigned __int128) 0) != 0
549 || !expr_has_type (__builtin_stdc_count_ones ((unsigned __int128) 0), unsigned int)
550 || __builtin_stdc_count_ones (~(unsigned __int128) 0) != __SIZEOF_INT128__ * __CHAR_BIT__)
551 __builtin_abort ();
552 if (__builtin_stdc_has_single_bit ((unsigned __int128) 0)
553 || !expr_has_type (__builtin_stdc_has_single_bit ((unsigned __int128) 0), _Bool)
554 || __builtin_stdc_has_single_bit (~(unsigned __int128) 0))
555 __builtin_abort ();
556 if (__builtin_stdc_bit_width ((unsigned __int128) 0) != 0
557 || !expr_has_type (__builtin_stdc_bit_width ((unsigned __int128) 0), unsigned int)
558 || __builtin_stdc_bit_width (~(unsigned __int128) 0) != __SIZEOF_INT128__ * __CHAR_BIT__)
559 __builtin_abort ();
560 if (__builtin_stdc_bit_floor ((unsigned __int128) 0) != 0
561 || !expr_has_type (__builtin_stdc_bit_floor ((unsigned __int128) 0), unsigned __int128)
562 || __builtin_stdc_bit_floor (~(unsigned __int128) 0) != ((unsigned __int128) 1) << (__SIZEOF_INT128__ * __CHAR_BIT__ - 1))
563 __builtin_abort ();
564 if (__builtin_stdc_bit_ceil ((unsigned __int128) 0) != 1
565 || !expr_has_type (__builtin_stdc_bit_ceil ((unsigned __int128) 0), unsigned __int128)
566 || __builtin_stdc_bit_ceil ((unsigned __int128) 1) != 1
567 || __builtin_stdc_bit_ceil ((~(unsigned __int128) 0) >> 1) != ((unsigned __int128) 1) << (__SIZEOF_INT128__ * __CHAR_BIT__ - 1)
568 || __builtin_stdc_bit_ceil (~(unsigned __int128) 0) != 0)
569 __builtin_abort ();
570 #endif
571 #if __has_builtin (__builtin_stdc_leading_zeros) != 1
572 #error __builtin_stdc_leading_zeros not implemented
573 #endif
574 #if __has_builtin (__builtin_stdc_leading_ones) != 1
575 #error __builtin_stdc_leading_ones not implemented
576 #endif
577 #if __has_builtin (__builtin_stdc_trailing_zeros) != 1
578 #error __builtin_stdc_trailing_zeros not implemented
579 #endif
580 #if __has_builtin (__builtin_stdc_trailing_ones) != 1
581 #error __builtin_stdc_trailing_ones not implemented
582 #endif
583 #if __has_builtin (__builtin_stdc_first_leading_zero) != 1
584 #error __builtin_stdc_first_leading_zero not implemented
585 #endif
586 #if __has_builtin (__builtin_stdc_first_leading_one) != 1
587 #error __builtin_stdc_first_leading_one not implemented
588 #endif
589 #if __has_builtin (__builtin_stdc_first_trailing_zero) != 1
590 #error __builtin_stdc_first_trailing_zero not implemented
591 #endif
592 #if __has_builtin (__builtin_stdc_first_trailing_one) != 1
593 #error __builtin_stdc_first_trailing_one not implemented
594 #endif
595 #if __has_builtin (__builtin_stdc_count_zeros) != 1
596 #error __builtin_stdc_count_zeros not implemented
597 #endif
598 #if __has_builtin (__builtin_stdc_count_ones) != 1
599 #error __builtin_stdc_count_ones not implemented
600 #endif
601 #if __has_builtin (__builtin_stdc_has_single_bit) != 1
602 #error __builtin_stdc_single_bit not implemented
603 #endif
604 #if __has_builtin (__builtin_stdc_bit_width) != 1
605 #error __builtin_stdc_bit_width not implemented
606 #endif
607 #if __has_builtin (__builtin_stdc_bit_floor) != 1
608 #error __builtin_stdc_bit_floor not implemented
609 #endif
610 #if __has_builtin (__builtin_stdc_bit_ceil) != 1
611 #error __builtin_stdc_bit_ceil not implemented
612 #endif
613 unsigned char a = 0;
614 if (__builtin_stdc_bit_width (a++) != 0 || a != 1)
615 __builtin_abort ();
616 unsigned long long b = 0;
617 if (__builtin_stdc_bit_width (b++) != 0 || b != 1)
618 __builtin_abort ();
619 if (__builtin_stdc_bit_floor (a++) != 1 || a != 2)
620 __builtin_abort ();
621 if (__builtin_stdc_bit_floor (b++) != 1 || b != 2)
622 __builtin_abort ();
623 if (__builtin_stdc_bit_ceil (a++) != 2 || a != 3)
624 __builtin_abort ();
625 if (__builtin_stdc_bit_ceil (b++) != 2 || b != 3)
626 __builtin_abort ();
627 if (__builtin_stdc_leading_zeros (a++) != __CHAR_BIT__ - 2 || a != 4)
628 __builtin_abort ();
629 if (__builtin_stdc_leading_zeros (b++) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 2 || b != 4)
630 __builtin_abort ();
631 if (__builtin_stdc_leading_ones (a++) != 0 || a != 5)
632 __builtin_abort ();
633 if (__builtin_stdc_leading_ones (b++) != 0 || b != 5)
634 __builtin_abort ();
635 if (__builtin_stdc_trailing_zeros (a++) != 0 || a != 6)
636 __builtin_abort ();
637 if (__builtin_stdc_trailing_zeros (b++) != 0 || b != 6)
638 __builtin_abort ();
639 if (__builtin_stdc_trailing_ones (a++) != 0 || a != 7)
640 __builtin_abort ();
641 if (__builtin_stdc_trailing_ones (b++) != 0 || b != 7)
642 __builtin_abort ();
643 if (__builtin_stdc_first_leading_zero (a++) != 1 || a != 8)
644 __builtin_abort ();
645 if (__builtin_stdc_first_leading_zero (b++) != 1 || b != 8)
646 __builtin_abort ();
647 if (__builtin_stdc_first_leading_one (a++) != __CHAR_BIT__ - 3 || a != 9)
648 __builtin_abort ();
649 if (__builtin_stdc_first_leading_one (b++) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 3 || b != 9)
650 __builtin_abort ();
651 if (__builtin_stdc_first_trailing_zero (a++) != 2 || a != 10)
652 __builtin_abort ();
653 if (__builtin_stdc_first_trailing_zero (b++) != 2 || b != 10)
654 __builtin_abort ();
655 if (__builtin_stdc_first_trailing_one (a++) != 2 || a != 11)
656 __builtin_abort ();
657 if (__builtin_stdc_first_trailing_one (b++) != 2 || b != 11)
658 __builtin_abort ();
659 if (__builtin_stdc_count_zeros (a++) != __CHAR_BIT__ - 3 || a != 12)
660 __builtin_abort ();
661 if (__builtin_stdc_count_zeros (b++) != __SIZEOF_LONG_LONG__ * __CHAR_BIT__ - 3 || b != 12)
662 __builtin_abort ();
663 if (__builtin_stdc_count_ones (a++) != 2 || a != 13)
664 __builtin_abort ();
665 if (__builtin_stdc_count_ones (b++) != 2 || b != 13)
666 __builtin_abort ();
667 if (__builtin_stdc_has_single_bit (a++) || a != 14)
668 __builtin_abort ();
669 if (__builtin_stdc_has_single_bit (b++) || b != 14)
670 __builtin_abort ();
671 #if __BITINT_MAXWIDTH__ >= 64
672 if (__builtin_stdc_leading_zeros (0uwb) != 1
673 || !expr_has_type (__builtin_stdc_leading_zeros (0uwb), unsigned int)
674 || __builtin_stdc_leading_zeros (1uwb) != 0
675 || !expr_has_type (__builtin_stdc_leading_zeros (1uwb), unsigned int))
676 __builtin_abort ();
677 if (__builtin_stdc_leading_ones (0uwb) != 0
678 || !expr_has_type (__builtin_stdc_leading_ones (0uwb), unsigned int)
679 || __builtin_stdc_leading_ones (1uwb) != 1
680 || !expr_has_type (__builtin_stdc_leading_ones (1uwb), unsigned int))
681 __builtin_abort ();
682 if (__builtin_stdc_trailing_zeros (0uwb) != 1
683 || !expr_has_type (__builtin_stdc_trailing_zeros (0uwb), unsigned int)
684 || __builtin_stdc_trailing_zeros (1uwb) != 0
685 || !expr_has_type (__builtin_stdc_trailing_zeros (1uwb), unsigned int))
686 __builtin_abort ();
687 if (__builtin_stdc_trailing_ones (0uwb) != 0
688 || !expr_has_type (__builtin_stdc_trailing_ones (0uwb), unsigned int)
689 || __builtin_stdc_trailing_ones (1uwb) != 1
690 || !expr_has_type (__builtin_stdc_trailing_ones (1uwb), unsigned int))
691 __builtin_abort ();
692 if (__builtin_stdc_first_leading_zero (0uwb) != 1
693 || !expr_has_type (__builtin_stdc_first_leading_zero (0uwb), unsigned int)
694 || __builtin_stdc_first_leading_zero (1uwb) != 0
695 || !expr_has_type (__builtin_stdc_first_leading_zero (1uwb), unsigned int))
696 __builtin_abort ();
697 if (__builtin_stdc_first_leading_one (0uwb) != 0
698 || !expr_has_type (__builtin_stdc_first_leading_one (0uwb), unsigned int)
699 || __builtin_stdc_first_leading_one (1uwb) != 1
700 || !expr_has_type (__builtin_stdc_first_leading_one (1uwb), unsigned int))
701 __builtin_abort ();
702 if (__builtin_stdc_first_trailing_zero (0uwb) != 1
703 || !expr_has_type (__builtin_stdc_first_trailing_zero (0uwb), unsigned int)
704 || __builtin_stdc_first_trailing_zero (1uwb) != 0
705 || !expr_has_type (__builtin_stdc_first_trailing_zero (1uwb), unsigned int))
706 __builtin_abort ();
707 if (__builtin_stdc_first_trailing_one (0uwb) != 0
708 || !expr_has_type (__builtin_stdc_first_trailing_one (0uwb), unsigned int)
709 || __builtin_stdc_first_trailing_one (1uwb) != 1
710 || !expr_has_type (__builtin_stdc_first_trailing_one (1uwb), unsigned int))
711 __builtin_abort ();
712 if (__builtin_stdc_count_zeros (0uwb) != 1
713 || !expr_has_type (__builtin_stdc_count_zeros (0uwb), unsigned int)
714 || __builtin_stdc_count_zeros (1uwb) != 0
715 || !expr_has_type (__builtin_stdc_count_zeros (1uwb), unsigned int))
716 __builtin_abort ();
717 if (__builtin_stdc_count_ones (0uwb) != 0
718 || !expr_has_type (__builtin_stdc_count_ones (0uwb), unsigned int)
719 || __builtin_stdc_count_ones (1uwb) != 1
720 || !expr_has_type (__builtin_stdc_count_ones (1uwb), unsigned int))
721 __builtin_abort ();
722 if (__builtin_stdc_has_single_bit (0uwb)
723 || !expr_has_type (__builtin_stdc_has_single_bit (0uwb), _Bool)
724 || !__builtin_stdc_has_single_bit (1uwb)
725 || !expr_has_type (__builtin_stdc_has_single_bit (1uwb), _Bool))
726 __builtin_abort ();
727 if (__builtin_stdc_bit_width (0uwb) != 0
728 || !expr_has_type (__builtin_stdc_bit_width (0uwb), unsigned int)
729 || __builtin_stdc_bit_width (1uwb) != 1
730 || !expr_has_type (__builtin_stdc_bit_width (1uwb), unsigned int))
731 __builtin_abort ();
732 if (__builtin_stdc_bit_floor (0uwb) != 0
733 || !expr_has_type (__builtin_stdc_bit_floor (0uwb), unsigned _BitInt(1))
734 || __builtin_stdc_bit_floor (1uwb) != 1
735 || !expr_has_type (__builtin_stdc_bit_floor (1uwb), unsigned _BitInt(1)))
736 __builtin_abort ();
737 if (__builtin_stdc_bit_ceil (0uwb) != 1
738 || !expr_has_type (__builtin_stdc_bit_ceil (0uwb), unsigned _BitInt(1))
739 || __builtin_stdc_bit_ceil (1uwb) != 1
740 || !expr_has_type (__builtin_stdc_bit_ceil (1uwb), unsigned _BitInt(1)))
741 __builtin_abort ();
742 unsigned _BitInt(1) c = 0;
743 if (__builtin_stdc_bit_floor (c++) != 0 || c != 1)
744 __builtin_abort ();
745 if (__builtin_stdc_bit_floor (c++) != 1 || c != 0)
746 __builtin_abort ();
747 if (__builtin_stdc_bit_ceil (c++) != 1 || c != 1)
748 __builtin_abort ();
749 if (__builtin_stdc_bit_ceil (c++) != 1 || c != 0)
750 __builtin_abort ();
751 #endif
752 #if __BITINT_MAXWIDTH__ >= 512
753 if (__builtin_stdc_leading_zeros ((unsigned _BitInt(512)) 0) != 512
754 || !expr_has_type (__builtin_stdc_leading_zeros ((unsigned _BitInt(512)) 0), unsigned int)
755 || __builtin_stdc_leading_zeros ((unsigned _BitInt(373)) 0) != 373
756 || !expr_has_type (__builtin_stdc_leading_zeros ((unsigned _BitInt(373)) 0), unsigned int))
757 __builtin_abort ();
758 if (__builtin_stdc_leading_zeros (~(unsigned _BitInt(512)) 0) != 0
759 || __builtin_stdc_leading_zeros (~(unsigned _BitInt(373)) 0) != 0)
760 __builtin_abort ();
761 if (__builtin_stdc_leading_zeros ((unsigned _BitInt(512)) 275) != 512 - 9
762 || __builtin_stdc_leading_zeros ((unsigned _BitInt(373)) 512) != 373 - 10)
763 __builtin_abort ();
764 if (__builtin_stdc_leading_ones ((unsigned _BitInt(512)) 0) != 0
765 || !expr_has_type (__builtin_stdc_leading_ones ((unsigned _BitInt(512)) 0), unsigned int)
766 || __builtin_stdc_leading_ones ((unsigned _BitInt(373)) 0) != 0
767 || !expr_has_type (__builtin_stdc_leading_ones ((unsigned _BitInt(373)) 0), unsigned int))
768 __builtin_abort ();
769 if (__builtin_stdc_leading_ones (~(unsigned _BitInt(512)) 0) != 512
770 || __builtin_stdc_leading_ones (~(unsigned _BitInt(373)) 0) != 373)
771 __builtin_abort ();
772 if (__builtin_stdc_leading_ones (~(unsigned _BitInt(512)) 275) != 512 - 9
773 || __builtin_stdc_leading_ones (~(unsigned _BitInt(373)) 512) != 373 - 10)
774 __builtin_abort ();
775 if (__builtin_stdc_trailing_zeros ((unsigned _BitInt(512)) 0) != 512
776 || !expr_has_type (__builtin_stdc_trailing_zeros ((unsigned _BitInt(512)) 0), unsigned int)
777 || __builtin_stdc_trailing_zeros ((unsigned _BitInt(373)) 0) != 373
778 || !expr_has_type (__builtin_stdc_trailing_zeros ((unsigned _BitInt(373)) 0), unsigned int))
779 __builtin_abort ();
780 if (__builtin_stdc_trailing_zeros (~(unsigned _BitInt(512)) 0) != 0
781 || __builtin_stdc_trailing_zeros (~(unsigned _BitInt(373)) 0) != 0)
782 __builtin_abort ();
783 if (__builtin_stdc_trailing_zeros ((unsigned _BitInt(512)) 256) != 8
784 || __builtin_stdc_trailing_zeros ((unsigned _BitInt(373)) 512) != 9)
785 __builtin_abort ();
786 if (__builtin_stdc_trailing_ones ((unsigned _BitInt(512)) 0) != 0
787 || !expr_has_type (__builtin_stdc_trailing_ones ((unsigned _BitInt(512)) 0), unsigned int)
788 || __builtin_stdc_trailing_ones ((unsigned _BitInt(373)) 0) != 0
789 || !expr_has_type (__builtin_stdc_trailing_ones ((unsigned _BitInt(373)) 0), unsigned int))
790 __builtin_abort ();
791 if (__builtin_stdc_trailing_ones (~(unsigned _BitInt(512)) 0) != 512
792 || __builtin_stdc_trailing_ones (~(unsigned _BitInt(373)) 0) != 373)
793 __builtin_abort ();
794 if (__builtin_stdc_trailing_ones ((unsigned _BitInt(512)) 255) != 8
795 || __builtin_stdc_trailing_ones ((~(unsigned _BitInt(373)) 0) >> 2) != 373 - 2)
796 __builtin_abort ();
797 if (__builtin_stdc_first_leading_zero ((unsigned _BitInt(512)) 0) != 1
798 || !expr_has_type (__builtin_stdc_first_leading_zero ((unsigned _BitInt(512)) 0), unsigned int)
799 || __builtin_stdc_first_leading_zero ((unsigned _BitInt(373)) 0) != 1
800 || !expr_has_type (__builtin_stdc_first_leading_zero ((unsigned _BitInt(373)) 0), unsigned int))
801 __builtin_abort ();
802 if (__builtin_stdc_first_leading_zero (~(unsigned _BitInt(512)) 0) != 0
803 || __builtin_stdc_first_leading_zero (~(unsigned _BitInt(373)) 0) != 0)
804 __builtin_abort ();
805 if (__builtin_stdc_first_leading_zero (~(unsigned _BitInt(512)) 511) != 512 - 8
806 || __builtin_stdc_first_leading_zero (~(unsigned _BitInt(373)) 1023) != 373 - 9)
807 __builtin_abort ();
808 if (__builtin_stdc_first_leading_one ((unsigned _BitInt(512)) 0) != 0
809 || !expr_has_type (__builtin_stdc_first_leading_one ((unsigned _BitInt(512)) 0), unsigned int)
810 || __builtin_stdc_first_leading_one ((unsigned _BitInt(373)) 0) != 0
811 || !expr_has_type (__builtin_stdc_first_leading_one ((unsigned _BitInt(373)) 0), unsigned int))
812 __builtin_abort ();
813 if (__builtin_stdc_first_leading_one (~(unsigned _BitInt(512)) 0) != 1
814 || __builtin_stdc_first_leading_one (~(unsigned _BitInt(373)) 0) != 1)
815 __builtin_abort ();
816 if (__builtin_stdc_first_leading_one ((unsigned _BitInt(512)) 275) != 512 - 8
817 || __builtin_stdc_first_leading_one ((unsigned _BitInt(373)) 512) != 373 - 9)
818 __builtin_abort ();
819 if (__builtin_stdc_first_trailing_zero ((unsigned _BitInt(512)) 0) != 1
820 || !expr_has_type (__builtin_stdc_first_trailing_zero ((unsigned _BitInt(512)) 0), unsigned int)
821 || __builtin_stdc_first_trailing_zero ((unsigned _BitInt(373)) 0) != 1
822 || !expr_has_type (__builtin_stdc_first_trailing_zero ((unsigned _BitInt(373)) 0), unsigned int))
823 __builtin_abort ();
824 if (__builtin_stdc_first_trailing_zero (~(unsigned _BitInt(512)) 0) != 0
825 || __builtin_stdc_first_trailing_zero (~(unsigned _BitInt(373)) 0) != 0)
826 __builtin_abort ();
827 if (__builtin_stdc_first_trailing_zero ((unsigned _BitInt(512)) 255) != 9
828 || __builtin_stdc_first_trailing_zero ((unsigned _BitInt(373)) 511) != 10)
829 __builtin_abort ();
830 if (__builtin_stdc_first_trailing_one ((unsigned _BitInt(512)) 0) != 0
831 || !expr_has_type (__builtin_stdc_first_trailing_one ((unsigned _BitInt(512)) 0), unsigned int)
832 || __builtin_stdc_first_trailing_one ((unsigned _BitInt(373)) 0) != 0
833 || !expr_has_type (__builtin_stdc_first_trailing_one ((unsigned _BitInt(373)) 0), unsigned int))
834 __builtin_abort ();
835 if (__builtin_stdc_first_trailing_one (~(unsigned _BitInt(512)) 0) != 1
836 || __builtin_stdc_first_trailing_one (~(unsigned _BitInt(373)) 0) != 1)
837 __builtin_abort ();
838 if (__builtin_stdc_first_trailing_one (((unsigned _BitInt(512)) 255) << 175) != 176
839 || __builtin_stdc_first_trailing_one ((~(unsigned _BitInt(373)) 0) << 311) != 312)
840 __builtin_abort ();
841 if (__builtin_stdc_count_zeros ((unsigned _BitInt(512)) 0) != 512
842 || !expr_has_type (__builtin_stdc_count_zeros ((unsigned _BitInt(512)) 0), unsigned int)
843 || __builtin_stdc_count_zeros ((unsigned _BitInt(373)) 0) != 373
844 || !expr_has_type (__builtin_stdc_count_zeros ((unsigned _BitInt(373)) 0), unsigned int))
845 __builtin_abort ();
846 if (__builtin_stdc_count_zeros (~(unsigned _BitInt(512)) 0) != 0
847 || __builtin_stdc_count_zeros (~(unsigned _BitInt(373)) 0) != 0)
848 __builtin_abort ();
849 if (__builtin_stdc_count_zeros ((unsigned _BitInt(512)) 1315) != 512 - 5
850 || __builtin_stdc_count_zeros ((unsigned _BitInt(373)) 3363) != 373 - 6)
851 __builtin_abort ();
852 if (__builtin_stdc_count_ones ((unsigned _BitInt(512)) 0) != 0
853 || !expr_has_type (__builtin_stdc_count_ones ((unsigned _BitInt(512)) 0), unsigned int)
854 || __builtin_stdc_count_ones ((unsigned _BitInt(373)) 0) != 0
855 || !expr_has_type (__builtin_stdc_count_ones ((unsigned _BitInt(373)) 0), unsigned int))
856 __builtin_abort ();
857 if (__builtin_stdc_count_ones (~(unsigned _BitInt(512)) 0) != 512
858 || __builtin_stdc_count_ones (~(unsigned _BitInt(373)) 0) != 373)
859 __builtin_abort ();
860 if (__builtin_stdc_count_ones (~(unsigned _BitInt(512)) 1315) != 512 - 5
861 || __builtin_stdc_count_ones (~(unsigned _BitInt(373)) 3363) != 373 - 6)
862 __builtin_abort ();
863 if (__builtin_stdc_has_single_bit ((unsigned _BitInt(512)) 0)
864 || !expr_has_type (__builtin_stdc_has_single_bit ((unsigned _BitInt(512)) 0), _Bool)
865 || __builtin_stdc_has_single_bit ((unsigned _BitInt(373)) 0)
866 || !expr_has_type (__builtin_stdc_has_single_bit ((unsigned _BitInt(373)) 0), _Bool))
867 __builtin_abort ();
868 if (__builtin_stdc_has_single_bit (~(unsigned _BitInt(512)) 0)
869 || __builtin_stdc_has_single_bit (~(unsigned _BitInt(373)) 0))
870 __builtin_abort ();
871 if (__builtin_stdc_has_single_bit (((unsigned _BitInt(512)) 1022) << 279)
872 || __builtin_stdc_has_single_bit (((unsigned _BitInt(373)) 12) << 305))
873 __builtin_abort ();
874 if (__builtin_stdc_bit_width ((unsigned _BitInt(512)) 0) != 0
875 || !expr_has_type (__builtin_stdc_bit_width ((unsigned _BitInt(512)) 0), unsigned int)
876 || __builtin_stdc_bit_width ((unsigned _BitInt(373)) 0) != 0
877 || !expr_has_type (__builtin_stdc_bit_width ((unsigned _BitInt(373)) 0), unsigned int))
878 __builtin_abort ();
879 if (__builtin_stdc_bit_width (~(unsigned _BitInt(512)) 0) != 512
880 || __builtin_stdc_bit_width (~(unsigned _BitInt(373)) 0) != 373)
881 __builtin_abort ();
882 if (__builtin_stdc_bit_width (((unsigned _BitInt(512)) 1023) << 405) != 405 + 10
883 || __builtin_stdc_bit_width (((unsigned _BitInt(373)) 1024) << 242) != 242 + 11)
884 __builtin_abort ();
885 if (__builtin_stdc_bit_floor ((unsigned _BitInt(512)) 0) != 0
886 || !expr_has_type (__builtin_stdc_bit_floor ((unsigned _BitInt(512)) 0), unsigned _BitInt(512))
887 || __builtin_stdc_bit_floor ((unsigned _BitInt(373)) 0) != 0
888 || !expr_has_type (__builtin_stdc_bit_floor ((unsigned _BitInt(373)) 0), unsigned _BitInt(373)))
889 __builtin_abort ();
890 if (__builtin_stdc_bit_floor (~(unsigned _BitInt(512)) 0) != ((unsigned _BitInt(512)) 1) << (512 - 1)
891 || __builtin_stdc_bit_floor (~(unsigned _BitInt(373)) 0) != ((unsigned _BitInt(373)) 1) << (373 - 1))
892 __builtin_abort ();
893 if (__builtin_stdc_bit_floor (((unsigned _BitInt(512)) 511) << 405) != (((unsigned _BitInt(512)) 256) << 405)
894 || __builtin_stdc_bit_floor (((unsigned _BitInt(373)) 512) << 242) != (((unsigned _BitInt(512)) 512) << 242))
895 __builtin_abort ();
896 if (__builtin_stdc_bit_ceil ((unsigned _BitInt(512)) 0) != 1
897 || !expr_has_type (__builtin_stdc_bit_ceil ((unsigned _BitInt(512)) 0), unsigned _BitInt(512))
898 || __builtin_stdc_bit_ceil ((unsigned _BitInt(373)) 0) != 1
899 || !expr_has_type (__builtin_stdc_bit_ceil ((unsigned _BitInt(373)) 0), unsigned _BitInt(373)))
900 __builtin_abort ();
901 if (__builtin_stdc_bit_ceil (~(unsigned _BitInt(512)) 0) != 0
902 || __builtin_stdc_bit_ceil (~(unsigned _BitInt(373)) 0) != 0)
903 __builtin_abort ();
904 if (__builtin_stdc_bit_ceil (((unsigned _BitInt(512)) 1) << (512 - 1)) != ((unsigned _BitInt(512)) 1) << (512 - 1)
905 || __builtin_stdc_bit_ceil ((~(unsigned _BitInt(373)) 0) >> 1) != ((unsigned _BitInt(373)) 1) << (373 - 1))
906 __builtin_abort ();
907 if (__builtin_stdc_bit_ceil (((unsigned _BitInt(512)) 512) << 405) != (((unsigned _BitInt(512)) 512) << 405)
908 || __builtin_stdc_bit_ceil (((unsigned _BitInt(373)) 513) << 242) != (((unsigned _BitInt(512)) 1024) << 242))
909 __builtin_abort ();
910 if (__builtin_stdc_bit_floor ((unsigned _BitInt(__BITINT_MAXWIDTH__)) 0) != 0)
911 __builtin_abort ();
912 if (__builtin_stdc_bit_floor (~(unsigned _BitInt(__BITINT_MAXWIDTH__)) 0) != ((unsigned _BitInt(__BITINT_MAXWIDTH__)) 1) << (__BITINT_MAXWIDTH__ - 1))
913 __builtin_abort ();
914 if (__builtin_stdc_bit_floor (((unsigned _BitInt(__BITINT_MAXWIDTH__)) 511) << 405) != (((unsigned _BitInt(__BITINT_MAXWIDTH__)) 256) << 405)
915 || __builtin_stdc_bit_floor (((unsigned _BitInt(__BITINT_MAXWIDTH__)) 512) << 405) != (((unsigned _BitInt(__BITINT_MAXWIDTH__)) 512) << 405))
916 __builtin_abort ();
917 if (__builtin_stdc_bit_ceil ((unsigned _BitInt(__BITINT_MAXWIDTH__)) 0) != 1)
918 __builtin_abort ();
919 if (__builtin_stdc_bit_ceil (~(unsigned _BitInt(__BITINT_MAXWIDTH__)) 0) != 0)
920 __builtin_abort ();
921 if (__builtin_stdc_bit_ceil (((unsigned _BitInt(__BITINT_MAXWIDTH__)) 1) << (__BITINT_MAXWIDTH__ - 1)) != ((unsigned _BitInt(__BITINT_MAXWIDTH__)) 1) << (__BITINT_MAXWIDTH__ - 1))
922 __builtin_abort ();
923 if (__builtin_stdc_bit_ceil (((unsigned _BitInt(__BITINT_MAXWIDTH__)) 512) << 405) != (((unsigned _BitInt(__BITINT_MAXWIDTH__)) 512) << 405)
924 || __builtin_stdc_bit_ceil (((unsigned _BitInt(__BITINT_MAXWIDTH__)) 513) << 405) != (((unsigned _BitInt(__BITINT_MAXWIDTH__)) 1024) << 405))
925 __builtin_abort ();
926 #endif