1 |
689 |
jeremybenn |
/* Test for integer constant types. */
|
2 |
|
|
|
3 |
|
|
/* Origin: Joseph Myers <jsm28@cam.ac.uk>. */
|
4 |
|
|
/* { dg-do compile } */
|
5 |
|
|
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
|
6 |
|
|
|
7 |
|
|
#include <limits.h>
|
8 |
|
|
|
9 |
|
|
/* Assertion that constant C is of type T. */
|
10 |
|
|
#define ASSERT_CONST_TYPE(C, T) \
|
11 |
|
|
do { \
|
12 |
|
|
typedef T type; \
|
13 |
|
|
typedef type **typepp; \
|
14 |
|
|
typedef __typeof__((C)) ctype; \
|
15 |
|
|
typedef ctype **ctypepp; \
|
16 |
|
|
typepp x = 0; \
|
17 |
|
|
ctypepp y = 0; \
|
18 |
|
|
x = y; \
|
19 |
|
|
y = x; \
|
20 |
|
|
} while (0)
|
21 |
|
|
|
22 |
|
|
/* (T *) if E is zero, (void *) otherwise. */
|
23 |
|
|
#define type_if_not(T, E) __typeof__(0 ? (T *)0 : (void *)(E))
|
24 |
|
|
|
25 |
|
|
/* (T *) if E is nonzero, (void *) otherwise. */
|
26 |
|
|
#define type_if(T, E) type_if_not(T, !(E))
|
27 |
|
|
|
28 |
|
|
/* Combine pointer types, all but one (void *). */
|
29 |
|
|
#define type_comb2(T1, T2) __typeof__(0 ? (T1)0 : (T2)0)
|
30 |
|
|
#define type_comb3(T1, T2, T3) type_comb2(T1, type_comb2(T2, T3))
|
31 |
|
|
#define type_comb4(T1, T2, T3, T4) \
|
32 |
|
|
type_comb2(T1, type_comb2(T2, type_comb2(T3, T4)))
|
33 |
|
|
#define type_comb6(T1, T2, T3, T4, T5, T6) \
|
34 |
|
|
type_comb2(T1, \
|
35 |
|
|
type_comb2(T2, \
|
36 |
|
|
type_comb2(T3, \
|
37 |
|
|
type_comb2(T4, \
|
38 |
|
|
type_comb2(T5, T6)))))
|
39 |
|
|
|
40 |
|
|
/* (T1 *) if E1, otherwise (T2 *) if E2. */
|
41 |
|
|
#define first_of2p(T1, E1, T2, E2) type_comb2(type_if(T1, (E1)), \
|
42 |
|
|
type_if(T2, (!(E1) && (E2))))
|
43 |
|
|
/* (T1 *) if E1, otherwise (T2 *) if E2, otherwise (T3 *) if E3. */
|
44 |
|
|
#define first_of3p(T1, E1, T2, E2, T3, E3) \
|
45 |
|
|
type_comb3(type_if(T1, (E1)), \
|
46 |
|
|
type_if(T2, (!(E1) && (E2))), \
|
47 |
|
|
type_if(T3, (!(E1) && !(E2) && (E3))))
|
48 |
|
|
/* (T1 *) if E1, otherwise (T2 *) if E2, otherwise (T3 *) if E3, otherwise
|
49 |
|
|
(T4 *) if E4. */
|
50 |
|
|
#define first_of4p(T1, E1, T2, E2, T3, E3, T4, E4) \
|
51 |
|
|
type_comb4(type_if(T1, (E1)), \
|
52 |
|
|
type_if(T2, (!(E1) && (E2))), \
|
53 |
|
|
type_if(T3, (!(E1) && !(E2) && (E3))), \
|
54 |
|
|
type_if(T4, (!(E1) && !(E2) && !(E3) && (E4))))
|
55 |
|
|
/* (T1 *) if E1, otherwise (T2 *) if E2, otherwise (T3 *) if E3, otherwise
|
56 |
|
|
(T4 *) if E4, otherwise (T5 *) if E5, otherwise (T6 *) if E6. */
|
57 |
|
|
#define first_of6p(T1, E1, T2, E2, T3, E3, T4, E4, T5, E5, T6, E6) \
|
58 |
|
|
type_comb6(type_if(T1, (E1)), \
|
59 |
|
|
type_if(T2, (!(E1) && (E2))), \
|
60 |
|
|
type_if(T3, (!(E1) && !(E2) && (E3))), \
|
61 |
|
|
type_if(T4, (!(E1) && !(E2) && !(E3) && (E4))), \
|
62 |
|
|
type_if(T5, (!(E1) && !(E2) && !(E3) && !(E4) && (E5))), \
|
63 |
|
|
type_if(T6, (!(E1) && !(E2) && !(E3) \
|
64 |
|
|
&& !(E4) && !(E5) && (E6))))
|
65 |
|
|
|
66 |
|
|
/* Likewise, but return the original type rather than a pointer type. */
|
67 |
|
|
#define first_of2(T1, E1, T2, E2) \
|
68 |
|
|
__typeof__(*((first_of2p(T1, (E1), T2, (E2)))0))
|
69 |
|
|
#define first_of3(T1, E1, T2, E2, T3, E3) \
|
70 |
|
|
__typeof__(*((first_of3p(T1, (E1), T2, (E2), T3, (E3)))0))
|
71 |
|
|
#define first_of4(T1, E1, T2, E2, T3, E3, T4, E4) \
|
72 |
|
|
__typeof__(*((first_of4p(T1, (E1), T2, (E2), T3, (E3), T4, (E4)))0))
|
73 |
|
|
#define first_of6(T1, E1, T2, E2, T3, E3, T4, E4, T5, E5, T6, E6) \
|
74 |
|
|
__typeof__(*((first_of6p(T1, (E1), T2, (E2), T3, (E3), \
|
75 |
|
|
T4, (E4), T5, (E5), T6, (E6)))0))
|
76 |
|
|
|
77 |
|
|
/* Types of constants according to the C99 rules. */
|
78 |
|
|
#define C99_UNSUF_DEC_TYPE(C) \
|
79 |
|
|
first_of3(int, (C) <= INT_MAX, \
|
80 |
|
|
long int, (C) <= LONG_MAX, \
|
81 |
|
|
long long int, (C) <= LLONG_MAX)
|
82 |
|
|
#define C99_UNSUF_OCTHEX_TYPE(C) \
|
83 |
|
|
first_of6(int, (C) <= INT_MAX, \
|
84 |
|
|
unsigned int, (C) <= UINT_MAX, \
|
85 |
|
|
long int, (C) <= LONG_MAX, \
|
86 |
|
|
unsigned long int, (C) <= ULONG_MAX, \
|
87 |
|
|
long long int, (C) <= LLONG_MAX, \
|
88 |
|
|
unsigned long long int, (C) <= ULLONG_MAX)
|
89 |
|
|
#define C99_SUFu_TYPE(C) \
|
90 |
|
|
first_of3(unsigned int, (C) <= UINT_MAX, \
|
91 |
|
|
unsigned long int, (C) <= ULONG_MAX, \
|
92 |
|
|
unsigned long long int, (C) <= ULLONG_MAX)
|
93 |
|
|
#define C99_SUFl_DEC_TYPE(C) \
|
94 |
|
|
first_of2(long int, (C) <= LONG_MAX, \
|
95 |
|
|
long long int, (C) <= LLONG_MAX)
|
96 |
|
|
#define C99_SUFl_OCTHEX_TYPE(C) \
|
97 |
|
|
first_of4(long int, (C) <= LONG_MAX, \
|
98 |
|
|
unsigned long int, (C) <= ULONG_MAX, \
|
99 |
|
|
long long int, (C) <= LLONG_MAX, \
|
100 |
|
|
unsigned long long int, (C) <= ULLONG_MAX)
|
101 |
|
|
#define C99_SUFul_TYPE(C) \
|
102 |
|
|
first_of2(unsigned long int, (C) <= ULONG_MAX, \
|
103 |
|
|
unsigned long long int, (C) <= ULLONG_MAX)
|
104 |
|
|
#define C99_SUFll_OCTHEX_TYPE(C) \
|
105 |
|
|
first_of2(long long int, (C) <= LLONG_MAX, \
|
106 |
|
|
unsigned long long int, (C) <= ULLONG_MAX)
|
107 |
|
|
|
108 |
|
|
/* Checks that constants have correct type. */
|
109 |
|
|
#define CHECK_UNSUF_DEC_TYPE(C) ASSERT_CONST_TYPE((C), C99_UNSUF_DEC_TYPE((C)))
|
110 |
|
|
#define CHECK_UNSUF_OCTHEX_TYPE(C) \
|
111 |
|
|
ASSERT_CONST_TYPE((C), C99_UNSUF_OCTHEX_TYPE((C)))
|
112 |
|
|
#define CHECK_SUFu_TYPE(C) ASSERT_CONST_TYPE((C), C99_SUFu_TYPE((C)))
|
113 |
|
|
#define CHECK_SUFl_DEC_TYPE(C) ASSERT_CONST_TYPE((C), C99_SUFl_DEC_TYPE((C)))
|
114 |
|
|
#define CHECK_SUFl_OCTHEX_TYPE(C) \
|
115 |
|
|
ASSERT_CONST_TYPE((C), C99_SUFl_OCTHEX_TYPE((C)))
|
116 |
|
|
#define CHECK_SUFul_TYPE(C) ASSERT_CONST_TYPE((C), C99_SUFul_TYPE((C)))
|
117 |
|
|
#define CHECK_SUFll_DEC_TYPE(C) ASSERT_CONST_TYPE((C), long long int)
|
118 |
|
|
#define CHECK_SUFll_OCTHEX_TYPE(C) \
|
119 |
|
|
ASSERT_CONST_TYPE((C), C99_SUFll_OCTHEX_TYPE((C)))
|
120 |
|
|
#define CHECK_SUFull_TYPE(C) ASSERT_CONST_TYPE((C), unsigned long long int)
|
121 |
|
|
|
122 |
|
|
/* Check a decimal value, with all suffixes. */
|
123 |
|
|
#define CHECK_DEC_CONST(C) \
|
124 |
|
|
CHECK_UNSUF_DEC_TYPE(C); \
|
125 |
|
|
CHECK_SUFu_TYPE(C##u); \
|
126 |
|
|
CHECK_SUFu_TYPE(C##U); \
|
127 |
|
|
CHECK_SUFl_DEC_TYPE(C##l); \
|
128 |
|
|
CHECK_SUFl_DEC_TYPE(C##L); \
|
129 |
|
|
CHECK_SUFul_TYPE(C##ul); \
|
130 |
|
|
CHECK_SUFul_TYPE(C##uL); \
|
131 |
|
|
CHECK_SUFul_TYPE(C##Ul); \
|
132 |
|
|
CHECK_SUFul_TYPE(C##UL); \
|
133 |
|
|
CHECK_SUFll_DEC_TYPE(C##ll); \
|
134 |
|
|
CHECK_SUFll_DEC_TYPE(C##LL); \
|
135 |
|
|
CHECK_SUFull_TYPE(C##ull); \
|
136 |
|
|
CHECK_SUFull_TYPE(C##uLL); \
|
137 |
|
|
CHECK_SUFull_TYPE(C##Ull); \
|
138 |
|
|
CHECK_SUFull_TYPE(C##ULL);
|
139 |
|
|
|
140 |
|
|
/* Check an octal or hexadecimal value, with all suffixes. */
|
141 |
|
|
#define CHECK_OCTHEX_CONST(C) \
|
142 |
|
|
CHECK_UNSUF_OCTHEX_TYPE(C); \
|
143 |
|
|
CHECK_SUFu_TYPE(C##u); \
|
144 |
|
|
CHECK_SUFu_TYPE(C##U); \
|
145 |
|
|
CHECK_SUFl_OCTHEX_TYPE(C##l); \
|
146 |
|
|
CHECK_SUFl_OCTHEX_TYPE(C##L); \
|
147 |
|
|
CHECK_SUFul_TYPE(C##ul); \
|
148 |
|
|
CHECK_SUFul_TYPE(C##uL); \
|
149 |
|
|
CHECK_SUFul_TYPE(C##Ul); \
|
150 |
|
|
CHECK_SUFul_TYPE(C##UL); \
|
151 |
|
|
CHECK_SUFll_OCTHEX_TYPE(C##ll); \
|
152 |
|
|
CHECK_SUFll_OCTHEX_TYPE(C##LL); \
|
153 |
|
|
CHECK_SUFull_TYPE(C##ull); \
|
154 |
|
|
CHECK_SUFull_TYPE(C##uLL); \
|
155 |
|
|
CHECK_SUFull_TYPE(C##Ull); \
|
156 |
|
|
CHECK_SUFull_TYPE(C##ULL);
|
157 |
|
|
|
158 |
|
|
#define CHECK_OCT_CONST(C) CHECK_OCTHEX_CONST(C)
|
159 |
|
|
#define CHECK_HEX_CONST(C) \
|
160 |
|
|
CHECK_OCTHEX_CONST(0x##C); \
|
161 |
|
|
CHECK_OCTHEX_CONST(0X##C);
|
162 |
|
|
|
163 |
|
|
/* True iff "long long" is at least B bits. This presumes that (B-2)/3 is at
|
164 |
|
|
most 63. */
|
165 |
|
|
#define LLONG_AT_LEAST(B) \
|
166 |
|
|
(LLONG_MAX >> ((B)-2)/3 >> ((B)-2)/3 \
|
167 |
|
|
>> ((B)-2 - ((B)-2)/3 - ((B)-2)/3))
|
168 |
|
|
|
169 |
|
|
#define LLONG_HAS_BITS(B) (LLONG_AT_LEAST((B)) && !LLONG_AT_LEAST((B) + 1))
|
170 |
|
|
|
171 |
|
|
void
|
172 |
|
|
foo (void)
|
173 |
|
|
{
|
174 |
|
|
/* Decimal. */
|
175 |
|
|
/* Check all 2^n and 2^n - 1 up to 2^71 - 1. */
|
176 |
|
|
CHECK_DEC_CONST(1);
|
177 |
|
|
CHECK_DEC_CONST(2);
|
178 |
|
|
CHECK_DEC_CONST(3);
|
179 |
|
|
CHECK_DEC_CONST(4);
|
180 |
|
|
CHECK_DEC_CONST(7);
|
181 |
|
|
CHECK_DEC_CONST(8);
|
182 |
|
|
CHECK_DEC_CONST(15);
|
183 |
|
|
CHECK_DEC_CONST(16);
|
184 |
|
|
CHECK_DEC_CONST(31);
|
185 |
|
|
CHECK_DEC_CONST(32);
|
186 |
|
|
CHECK_DEC_CONST(63);
|
187 |
|
|
CHECK_DEC_CONST(64);
|
188 |
|
|
CHECK_DEC_CONST(127);
|
189 |
|
|
CHECK_DEC_CONST(128);
|
190 |
|
|
CHECK_DEC_CONST(255);
|
191 |
|
|
CHECK_DEC_CONST(256);
|
192 |
|
|
CHECK_DEC_CONST(511);
|
193 |
|
|
CHECK_DEC_CONST(512);
|
194 |
|
|
CHECK_DEC_CONST(1023);
|
195 |
|
|
CHECK_DEC_CONST(1024);
|
196 |
|
|
CHECK_DEC_CONST(2047);
|
197 |
|
|
CHECK_DEC_CONST(2048);
|
198 |
|
|
CHECK_DEC_CONST(4095);
|
199 |
|
|
CHECK_DEC_CONST(4096);
|
200 |
|
|
CHECK_DEC_CONST(8191);
|
201 |
|
|
CHECK_DEC_CONST(8192);
|
202 |
|
|
CHECK_DEC_CONST(16383);
|
203 |
|
|
CHECK_DEC_CONST(16384);
|
204 |
|
|
CHECK_DEC_CONST(32767);
|
205 |
|
|
CHECK_DEC_CONST(32768);
|
206 |
|
|
CHECK_DEC_CONST(65535);
|
207 |
|
|
CHECK_DEC_CONST(65536);
|
208 |
|
|
CHECK_DEC_CONST(131071);
|
209 |
|
|
CHECK_DEC_CONST(131072);
|
210 |
|
|
CHECK_DEC_CONST(262143);
|
211 |
|
|
CHECK_DEC_CONST(262144);
|
212 |
|
|
CHECK_DEC_CONST(524287);
|
213 |
|
|
CHECK_DEC_CONST(524288);
|
214 |
|
|
CHECK_DEC_CONST(1048575);
|
215 |
|
|
CHECK_DEC_CONST(1048576);
|
216 |
|
|
CHECK_DEC_CONST(2097151);
|
217 |
|
|
CHECK_DEC_CONST(2097152);
|
218 |
|
|
CHECK_DEC_CONST(4194303);
|
219 |
|
|
CHECK_DEC_CONST(4194304);
|
220 |
|
|
CHECK_DEC_CONST(8388607);
|
221 |
|
|
CHECK_DEC_CONST(8388608);
|
222 |
|
|
CHECK_DEC_CONST(16777215);
|
223 |
|
|
CHECK_DEC_CONST(16777216);
|
224 |
|
|
CHECK_DEC_CONST(33554431);
|
225 |
|
|
CHECK_DEC_CONST(33554432);
|
226 |
|
|
CHECK_DEC_CONST(67108863);
|
227 |
|
|
CHECK_DEC_CONST(67108864);
|
228 |
|
|
CHECK_DEC_CONST(134217727);
|
229 |
|
|
CHECK_DEC_CONST(134217728);
|
230 |
|
|
CHECK_DEC_CONST(268435455);
|
231 |
|
|
CHECK_DEC_CONST(268435456);
|
232 |
|
|
CHECK_DEC_CONST(536870911);
|
233 |
|
|
CHECK_DEC_CONST(536870912);
|
234 |
|
|
CHECK_DEC_CONST(1073741823);
|
235 |
|
|
CHECK_DEC_CONST(1073741824);
|
236 |
|
|
CHECK_DEC_CONST(2147483647);
|
237 |
|
|
CHECK_DEC_CONST(2147483648);
|
238 |
|
|
CHECK_DEC_CONST(4294967295);
|
239 |
|
|
CHECK_DEC_CONST(4294967296);
|
240 |
|
|
CHECK_DEC_CONST(8589934591);
|
241 |
|
|
CHECK_DEC_CONST(8589934592);
|
242 |
|
|
CHECK_DEC_CONST(17179869183);
|
243 |
|
|
CHECK_DEC_CONST(17179869184);
|
244 |
|
|
CHECK_DEC_CONST(34359738367);
|
245 |
|
|
CHECK_DEC_CONST(34359738368);
|
246 |
|
|
CHECK_DEC_CONST(68719476735);
|
247 |
|
|
CHECK_DEC_CONST(68719476736);
|
248 |
|
|
CHECK_DEC_CONST(137438953471);
|
249 |
|
|
CHECK_DEC_CONST(137438953472);
|
250 |
|
|
CHECK_DEC_CONST(274877906943);
|
251 |
|
|
CHECK_DEC_CONST(274877906944);
|
252 |
|
|
CHECK_DEC_CONST(549755813887);
|
253 |
|
|
CHECK_DEC_CONST(549755813888);
|
254 |
|
|
CHECK_DEC_CONST(1099511627775);
|
255 |
|
|
CHECK_DEC_CONST(1099511627776);
|
256 |
|
|
CHECK_DEC_CONST(2199023255551);
|
257 |
|
|
CHECK_DEC_CONST(2199023255552);
|
258 |
|
|
CHECK_DEC_CONST(4398046511103);
|
259 |
|
|
CHECK_DEC_CONST(4398046511104);
|
260 |
|
|
CHECK_DEC_CONST(8796093022207);
|
261 |
|
|
CHECK_DEC_CONST(8796093022208);
|
262 |
|
|
CHECK_DEC_CONST(17592186044415);
|
263 |
|
|
CHECK_DEC_CONST(17592186044416);
|
264 |
|
|
CHECK_DEC_CONST(35184372088831);
|
265 |
|
|
CHECK_DEC_CONST(35184372088832);
|
266 |
|
|
CHECK_DEC_CONST(70368744177663);
|
267 |
|
|
CHECK_DEC_CONST(70368744177664);
|
268 |
|
|
CHECK_DEC_CONST(140737488355327);
|
269 |
|
|
CHECK_DEC_CONST(140737488355328);
|
270 |
|
|
CHECK_DEC_CONST(281474976710655);
|
271 |
|
|
CHECK_DEC_CONST(281474976710656);
|
272 |
|
|
CHECK_DEC_CONST(562949953421311);
|
273 |
|
|
CHECK_DEC_CONST(562949953421312);
|
274 |
|
|
CHECK_DEC_CONST(1125899906842623);
|
275 |
|
|
CHECK_DEC_CONST(1125899906842624);
|
276 |
|
|
CHECK_DEC_CONST(2251799813685247);
|
277 |
|
|
CHECK_DEC_CONST(2251799813685248);
|
278 |
|
|
CHECK_DEC_CONST(4503599627370495);
|
279 |
|
|
CHECK_DEC_CONST(4503599627370496);
|
280 |
|
|
CHECK_DEC_CONST(9007199254740991);
|
281 |
|
|
CHECK_DEC_CONST(9007199254740992);
|
282 |
|
|
CHECK_DEC_CONST(18014398509481983);
|
283 |
|
|
CHECK_DEC_CONST(18014398509481984);
|
284 |
|
|
CHECK_DEC_CONST(36028797018963967);
|
285 |
|
|
CHECK_DEC_CONST(36028797018963968);
|
286 |
|
|
CHECK_DEC_CONST(72057594037927935);
|
287 |
|
|
CHECK_DEC_CONST(72057594037927936);
|
288 |
|
|
CHECK_DEC_CONST(144115188075855871);
|
289 |
|
|
CHECK_DEC_CONST(144115188075855872);
|
290 |
|
|
CHECK_DEC_CONST(288230376151711743);
|
291 |
|
|
CHECK_DEC_CONST(288230376151711744);
|
292 |
|
|
CHECK_DEC_CONST(576460752303423487);
|
293 |
|
|
CHECK_DEC_CONST(576460752303423488);
|
294 |
|
|
CHECK_DEC_CONST(1152921504606846975);
|
295 |
|
|
CHECK_DEC_CONST(1152921504606846976);
|
296 |
|
|
CHECK_DEC_CONST(2305843009213693951);
|
297 |
|
|
CHECK_DEC_CONST(2305843009213693952);
|
298 |
|
|
CHECK_DEC_CONST(4611686018427387903);
|
299 |
|
|
CHECK_DEC_CONST(4611686018427387904);
|
300 |
|
|
CHECK_DEC_CONST(9223372036854775807);
|
301 |
|
|
#if LLONG_AT_LEAST(65)
|
302 |
|
|
CHECK_DEC_CONST(9223372036854775808);
|
303 |
|
|
CHECK_DEC_CONST(18446744073709551615);
|
304 |
|
|
#endif
|
305 |
|
|
#if LLONG_AT_LEAST(66)
|
306 |
|
|
CHECK_DEC_CONST(18446744073709551616);
|
307 |
|
|
CHECK_DEC_CONST(36893488147419103231);
|
308 |
|
|
#endif
|
309 |
|
|
#if LLONG_AT_LEAST(67)
|
310 |
|
|
CHECK_DEC_CONST(36893488147419103232);
|
311 |
|
|
CHECK_DEC_CONST(73786976294838206463);
|
312 |
|
|
#endif
|
313 |
|
|
#if LLONG_AT_LEAST(68)
|
314 |
|
|
CHECK_DEC_CONST(73786976294838206464);
|
315 |
|
|
CHECK_DEC_CONST(147573952589676412927);
|
316 |
|
|
#endif
|
317 |
|
|
#if LLONG_AT_LEAST(69)
|
318 |
|
|
CHECK_DEC_CONST(147573952589676412928);
|
319 |
|
|
CHECK_DEC_CONST(295147905179352825855);
|
320 |
|
|
#endif
|
321 |
|
|
#if LLONG_AT_LEAST(70)
|
322 |
|
|
CHECK_DEC_CONST(295147905179352825856);
|
323 |
|
|
CHECK_DEC_CONST(590295810358705651711);
|
324 |
|
|
#endif
|
325 |
|
|
#if LLONG_AT_LEAST(71)
|
326 |
|
|
CHECK_DEC_CONST(590295810358705651712);
|
327 |
|
|
CHECK_DEC_CONST(1180591620717411303423);
|
328 |
|
|
#endif
|
329 |
|
|
#if LLONG_AT_LEAST(72)
|
330 |
|
|
CHECK_DEC_CONST(1180591620717411303424);
|
331 |
|
|
CHECK_DEC_CONST(2361183241434822606847);
|
332 |
|
|
#endif
|
333 |
|
|
/* Octal and hexadecimal. */
|
334 |
|
|
/* Check all 2^n and 2^n - 1 up to 2^72 - 1. */
|
335 |
|
|
CHECK_OCT_CONST(0);
|
336 |
|
|
CHECK_HEX_CONST(0);
|
337 |
|
|
CHECK_OCT_CONST(01);
|
338 |
|
|
CHECK_HEX_CONST(1);
|
339 |
|
|
CHECK_OCT_CONST(02);
|
340 |
|
|
CHECK_HEX_CONST(2);
|
341 |
|
|
CHECK_OCT_CONST(03);
|
342 |
|
|
CHECK_HEX_CONST(3);
|
343 |
|
|
CHECK_OCT_CONST(04);
|
344 |
|
|
CHECK_HEX_CONST(4);
|
345 |
|
|
CHECK_OCT_CONST(07);
|
346 |
|
|
CHECK_HEX_CONST(7);
|
347 |
|
|
CHECK_OCT_CONST(010);
|
348 |
|
|
CHECK_HEX_CONST(8);
|
349 |
|
|
CHECK_OCT_CONST(017);
|
350 |
|
|
CHECK_HEX_CONST(f);
|
351 |
|
|
CHECK_OCT_CONST(020);
|
352 |
|
|
CHECK_HEX_CONST(10);
|
353 |
|
|
CHECK_OCT_CONST(037);
|
354 |
|
|
CHECK_HEX_CONST(1f);
|
355 |
|
|
CHECK_OCT_CONST(040);
|
356 |
|
|
CHECK_HEX_CONST(20);
|
357 |
|
|
CHECK_OCT_CONST(077);
|
358 |
|
|
CHECK_HEX_CONST(3f);
|
359 |
|
|
CHECK_OCT_CONST(0100);
|
360 |
|
|
CHECK_HEX_CONST(40);
|
361 |
|
|
CHECK_OCT_CONST(0177);
|
362 |
|
|
CHECK_HEX_CONST(7f);
|
363 |
|
|
CHECK_OCT_CONST(0200);
|
364 |
|
|
CHECK_HEX_CONST(80);
|
365 |
|
|
CHECK_OCT_CONST(0377);
|
366 |
|
|
CHECK_HEX_CONST(ff);
|
367 |
|
|
CHECK_OCT_CONST(0400);
|
368 |
|
|
CHECK_HEX_CONST(100);
|
369 |
|
|
CHECK_OCT_CONST(0777);
|
370 |
|
|
CHECK_HEX_CONST(1ff);
|
371 |
|
|
CHECK_OCT_CONST(01000);
|
372 |
|
|
CHECK_HEX_CONST(200);
|
373 |
|
|
CHECK_OCT_CONST(01777);
|
374 |
|
|
CHECK_HEX_CONST(3ff);
|
375 |
|
|
CHECK_OCT_CONST(02000);
|
376 |
|
|
CHECK_HEX_CONST(400);
|
377 |
|
|
CHECK_OCT_CONST(03777);
|
378 |
|
|
CHECK_HEX_CONST(7ff);
|
379 |
|
|
CHECK_OCT_CONST(04000);
|
380 |
|
|
CHECK_HEX_CONST(800);
|
381 |
|
|
CHECK_OCT_CONST(07777);
|
382 |
|
|
CHECK_HEX_CONST(fff);
|
383 |
|
|
CHECK_OCT_CONST(010000);
|
384 |
|
|
CHECK_HEX_CONST(1000);
|
385 |
|
|
CHECK_OCT_CONST(017777);
|
386 |
|
|
CHECK_HEX_CONST(1fff);
|
387 |
|
|
CHECK_OCT_CONST(020000);
|
388 |
|
|
CHECK_HEX_CONST(2000);
|
389 |
|
|
CHECK_OCT_CONST(037777);
|
390 |
|
|
CHECK_HEX_CONST(3fff);
|
391 |
|
|
CHECK_OCT_CONST(040000);
|
392 |
|
|
CHECK_HEX_CONST(4000);
|
393 |
|
|
CHECK_OCT_CONST(077777);
|
394 |
|
|
CHECK_HEX_CONST(7fff);
|
395 |
|
|
CHECK_OCT_CONST(0100000);
|
396 |
|
|
CHECK_HEX_CONST(8000);
|
397 |
|
|
CHECK_OCT_CONST(0177777);
|
398 |
|
|
CHECK_HEX_CONST(ffff);
|
399 |
|
|
CHECK_OCT_CONST(0200000);
|
400 |
|
|
CHECK_HEX_CONST(10000);
|
401 |
|
|
CHECK_OCT_CONST(0377777);
|
402 |
|
|
CHECK_HEX_CONST(1ffff);
|
403 |
|
|
CHECK_OCT_CONST(0400000);
|
404 |
|
|
CHECK_HEX_CONST(20000);
|
405 |
|
|
CHECK_OCT_CONST(0777777);
|
406 |
|
|
CHECK_HEX_CONST(3ffff);
|
407 |
|
|
CHECK_OCT_CONST(01000000);
|
408 |
|
|
CHECK_HEX_CONST(40000);
|
409 |
|
|
CHECK_OCT_CONST(01777777);
|
410 |
|
|
CHECK_HEX_CONST(7ffff);
|
411 |
|
|
CHECK_OCT_CONST(02000000);
|
412 |
|
|
CHECK_HEX_CONST(80000);
|
413 |
|
|
CHECK_OCT_CONST(03777777);
|
414 |
|
|
CHECK_HEX_CONST(fffff);
|
415 |
|
|
CHECK_OCT_CONST(04000000);
|
416 |
|
|
CHECK_HEX_CONST(100000);
|
417 |
|
|
CHECK_OCT_CONST(07777777);
|
418 |
|
|
CHECK_HEX_CONST(1fffff);
|
419 |
|
|
CHECK_OCT_CONST(010000000);
|
420 |
|
|
CHECK_HEX_CONST(200000);
|
421 |
|
|
CHECK_OCT_CONST(017777777);
|
422 |
|
|
CHECK_HEX_CONST(3fffff);
|
423 |
|
|
CHECK_OCT_CONST(020000000);
|
424 |
|
|
CHECK_HEX_CONST(400000);
|
425 |
|
|
CHECK_OCT_CONST(037777777);
|
426 |
|
|
CHECK_HEX_CONST(7fffff);
|
427 |
|
|
CHECK_OCT_CONST(040000000);
|
428 |
|
|
CHECK_HEX_CONST(800000);
|
429 |
|
|
CHECK_OCT_CONST(077777777);
|
430 |
|
|
CHECK_HEX_CONST(ffffff);
|
431 |
|
|
CHECK_OCT_CONST(0100000000);
|
432 |
|
|
CHECK_HEX_CONST(1000000);
|
433 |
|
|
CHECK_OCT_CONST(0177777777);
|
434 |
|
|
CHECK_HEX_CONST(1ffffff);
|
435 |
|
|
CHECK_OCT_CONST(0200000000);
|
436 |
|
|
CHECK_HEX_CONST(2000000);
|
437 |
|
|
CHECK_OCT_CONST(0377777777);
|
438 |
|
|
CHECK_HEX_CONST(3ffffff);
|
439 |
|
|
CHECK_OCT_CONST(0400000000);
|
440 |
|
|
CHECK_HEX_CONST(4000000);
|
441 |
|
|
CHECK_OCT_CONST(0777777777);
|
442 |
|
|
CHECK_HEX_CONST(7ffffff);
|
443 |
|
|
CHECK_OCT_CONST(01000000000);
|
444 |
|
|
CHECK_HEX_CONST(8000000);
|
445 |
|
|
CHECK_OCT_CONST(01777777777);
|
446 |
|
|
CHECK_HEX_CONST(fffffff);
|
447 |
|
|
CHECK_OCT_CONST(02000000000);
|
448 |
|
|
CHECK_HEX_CONST(10000000);
|
449 |
|
|
CHECK_OCT_CONST(03777777777);
|
450 |
|
|
CHECK_HEX_CONST(1fffffff);
|
451 |
|
|
CHECK_OCT_CONST(04000000000);
|
452 |
|
|
CHECK_HEX_CONST(20000000);
|
453 |
|
|
CHECK_OCT_CONST(07777777777);
|
454 |
|
|
CHECK_HEX_CONST(3fffffff);
|
455 |
|
|
CHECK_OCT_CONST(010000000000);
|
456 |
|
|
CHECK_HEX_CONST(40000000);
|
457 |
|
|
CHECK_OCT_CONST(017777777777);
|
458 |
|
|
CHECK_HEX_CONST(7fffffff);
|
459 |
|
|
CHECK_OCT_CONST(020000000000);
|
460 |
|
|
CHECK_HEX_CONST(80000000);
|
461 |
|
|
CHECK_OCT_CONST(037777777777);
|
462 |
|
|
CHECK_HEX_CONST(ffffffff);
|
463 |
|
|
CHECK_OCT_CONST(040000000000);
|
464 |
|
|
CHECK_HEX_CONST(100000000);
|
465 |
|
|
CHECK_OCT_CONST(077777777777);
|
466 |
|
|
CHECK_HEX_CONST(1ffffffff);
|
467 |
|
|
CHECK_OCT_CONST(0100000000000);
|
468 |
|
|
CHECK_HEX_CONST(200000000);
|
469 |
|
|
CHECK_OCT_CONST(0177777777777);
|
470 |
|
|
CHECK_HEX_CONST(3ffffffff);
|
471 |
|
|
CHECK_OCT_CONST(0200000000000);
|
472 |
|
|
CHECK_HEX_CONST(400000000);
|
473 |
|
|
CHECK_OCT_CONST(0377777777777);
|
474 |
|
|
CHECK_HEX_CONST(7ffffffff);
|
475 |
|
|
CHECK_OCT_CONST(0400000000000);
|
476 |
|
|
CHECK_HEX_CONST(800000000);
|
477 |
|
|
CHECK_OCT_CONST(0777777777777);
|
478 |
|
|
CHECK_HEX_CONST(fffffffff);
|
479 |
|
|
CHECK_OCT_CONST(01000000000000);
|
480 |
|
|
CHECK_HEX_CONST(1000000000);
|
481 |
|
|
CHECK_OCT_CONST(01777777777777);
|
482 |
|
|
CHECK_HEX_CONST(1fffffffff);
|
483 |
|
|
CHECK_OCT_CONST(02000000000000);
|
484 |
|
|
CHECK_HEX_CONST(2000000000);
|
485 |
|
|
CHECK_OCT_CONST(03777777777777);
|
486 |
|
|
CHECK_HEX_CONST(3fffffffff);
|
487 |
|
|
CHECK_OCT_CONST(04000000000000);
|
488 |
|
|
CHECK_HEX_CONST(4000000000);
|
489 |
|
|
CHECK_OCT_CONST(07777777777777);
|
490 |
|
|
CHECK_HEX_CONST(7fffffffff);
|
491 |
|
|
CHECK_OCT_CONST(010000000000000);
|
492 |
|
|
CHECK_HEX_CONST(8000000000);
|
493 |
|
|
CHECK_OCT_CONST(017777777777777);
|
494 |
|
|
CHECK_HEX_CONST(ffffffffff);
|
495 |
|
|
CHECK_OCT_CONST(020000000000000);
|
496 |
|
|
CHECK_HEX_CONST(10000000000);
|
497 |
|
|
CHECK_OCT_CONST(037777777777777);
|
498 |
|
|
CHECK_HEX_CONST(1ffffffffff);
|
499 |
|
|
CHECK_OCT_CONST(040000000000000);
|
500 |
|
|
CHECK_HEX_CONST(20000000000);
|
501 |
|
|
CHECK_OCT_CONST(077777777777777);
|
502 |
|
|
CHECK_HEX_CONST(3ffffffffff);
|
503 |
|
|
CHECK_OCT_CONST(0100000000000000);
|
504 |
|
|
CHECK_HEX_CONST(40000000000);
|
505 |
|
|
CHECK_OCT_CONST(0177777777777777);
|
506 |
|
|
CHECK_HEX_CONST(7ffffffffff);
|
507 |
|
|
CHECK_OCT_CONST(0200000000000000);
|
508 |
|
|
CHECK_HEX_CONST(80000000000);
|
509 |
|
|
CHECK_OCT_CONST(0377777777777777);
|
510 |
|
|
CHECK_HEX_CONST(fffffffffff);
|
511 |
|
|
CHECK_OCT_CONST(0400000000000000);
|
512 |
|
|
CHECK_HEX_CONST(100000000000);
|
513 |
|
|
CHECK_OCT_CONST(0777777777777777);
|
514 |
|
|
CHECK_HEX_CONST(1fffffffffff);
|
515 |
|
|
CHECK_OCT_CONST(01000000000000000);
|
516 |
|
|
CHECK_HEX_CONST(200000000000);
|
517 |
|
|
CHECK_OCT_CONST(01777777777777777);
|
518 |
|
|
CHECK_HEX_CONST(3fffffffffff);
|
519 |
|
|
CHECK_OCT_CONST(02000000000000000);
|
520 |
|
|
CHECK_HEX_CONST(400000000000);
|
521 |
|
|
CHECK_OCT_CONST(03777777777777777);
|
522 |
|
|
CHECK_HEX_CONST(7fffffffffff);
|
523 |
|
|
CHECK_OCT_CONST(04000000000000000);
|
524 |
|
|
CHECK_HEX_CONST(800000000000);
|
525 |
|
|
CHECK_OCT_CONST(07777777777777777);
|
526 |
|
|
CHECK_HEX_CONST(ffffffffffff);
|
527 |
|
|
CHECK_OCT_CONST(010000000000000000);
|
528 |
|
|
CHECK_HEX_CONST(1000000000000);
|
529 |
|
|
CHECK_OCT_CONST(017777777777777777);
|
530 |
|
|
CHECK_HEX_CONST(1ffffffffffff);
|
531 |
|
|
CHECK_OCT_CONST(020000000000000000);
|
532 |
|
|
CHECK_HEX_CONST(2000000000000);
|
533 |
|
|
CHECK_OCT_CONST(037777777777777777);
|
534 |
|
|
CHECK_HEX_CONST(3ffffffffffff);
|
535 |
|
|
CHECK_OCT_CONST(040000000000000000);
|
536 |
|
|
CHECK_HEX_CONST(4000000000000);
|
537 |
|
|
CHECK_OCT_CONST(077777777777777777);
|
538 |
|
|
CHECK_HEX_CONST(7ffffffffffff);
|
539 |
|
|
CHECK_OCT_CONST(0100000000000000000);
|
540 |
|
|
CHECK_HEX_CONST(8000000000000);
|
541 |
|
|
CHECK_OCT_CONST(0177777777777777777);
|
542 |
|
|
CHECK_HEX_CONST(fffffffffffff);
|
543 |
|
|
CHECK_OCT_CONST(0200000000000000000);
|
544 |
|
|
CHECK_HEX_CONST(10000000000000);
|
545 |
|
|
CHECK_OCT_CONST(0377777777777777777);
|
546 |
|
|
CHECK_HEX_CONST(1fffffffffffff);
|
547 |
|
|
CHECK_OCT_CONST(0400000000000000000);
|
548 |
|
|
CHECK_HEX_CONST(20000000000000);
|
549 |
|
|
CHECK_OCT_CONST(0777777777777777777);
|
550 |
|
|
CHECK_HEX_CONST(3fffffffffffff);
|
551 |
|
|
CHECK_OCT_CONST(01000000000000000000);
|
552 |
|
|
CHECK_HEX_CONST(40000000000000);
|
553 |
|
|
CHECK_OCT_CONST(01777777777777777777);
|
554 |
|
|
CHECK_HEX_CONST(7fffffffffffff);
|
555 |
|
|
CHECK_OCT_CONST(02000000000000000000);
|
556 |
|
|
CHECK_HEX_CONST(80000000000000);
|
557 |
|
|
CHECK_OCT_CONST(03777777777777777777);
|
558 |
|
|
CHECK_HEX_CONST(ffffffffffffff);
|
559 |
|
|
CHECK_OCT_CONST(04000000000000000000);
|
560 |
|
|
CHECK_HEX_CONST(100000000000000);
|
561 |
|
|
CHECK_OCT_CONST(07777777777777777777);
|
562 |
|
|
CHECK_HEX_CONST(1ffffffffffffff);
|
563 |
|
|
CHECK_OCT_CONST(010000000000000000000);
|
564 |
|
|
CHECK_HEX_CONST(200000000000000);
|
565 |
|
|
CHECK_OCT_CONST(017777777777777777777);
|
566 |
|
|
CHECK_HEX_CONST(3ffffffffffffff);
|
567 |
|
|
CHECK_OCT_CONST(020000000000000000000);
|
568 |
|
|
CHECK_HEX_CONST(400000000000000);
|
569 |
|
|
CHECK_OCT_CONST(037777777777777777777);
|
570 |
|
|
CHECK_HEX_CONST(7ffffffffffffff);
|
571 |
|
|
CHECK_OCT_CONST(040000000000000000000);
|
572 |
|
|
CHECK_HEX_CONST(800000000000000);
|
573 |
|
|
CHECK_OCT_CONST(077777777777777777777);
|
574 |
|
|
CHECK_HEX_CONST(fffffffffffffff);
|
575 |
|
|
CHECK_OCT_CONST(0100000000000000000000);
|
576 |
|
|
CHECK_HEX_CONST(1000000000000000);
|
577 |
|
|
CHECK_OCT_CONST(0177777777777777777777);
|
578 |
|
|
CHECK_HEX_CONST(1fffffffffffffff);
|
579 |
|
|
CHECK_OCT_CONST(0200000000000000000000);
|
580 |
|
|
CHECK_HEX_CONST(2000000000000000);
|
581 |
|
|
CHECK_OCT_CONST(0377777777777777777777);
|
582 |
|
|
CHECK_HEX_CONST(3fffffffffffffff);
|
583 |
|
|
CHECK_OCT_CONST(0400000000000000000000);
|
584 |
|
|
CHECK_HEX_CONST(4000000000000000);
|
585 |
|
|
CHECK_OCT_CONST(0777777777777777777777);
|
586 |
|
|
CHECK_HEX_CONST(7fffffffffffffff);
|
587 |
|
|
CHECK_OCT_CONST(01000000000000000000000);
|
588 |
|
|
CHECK_HEX_CONST(8000000000000000);
|
589 |
|
|
CHECK_OCT_CONST(01777777777777777777777);
|
590 |
|
|
CHECK_HEX_CONST(ffffffffffffffff);
|
591 |
|
|
#if LLONG_AT_LEAST(65)
|
592 |
|
|
CHECK_OCT_CONST(02000000000000000000000);
|
593 |
|
|
CHECK_HEX_CONST(10000000000000000);
|
594 |
|
|
CHECK_OCT_CONST(03777777777777777777777);
|
595 |
|
|
CHECK_HEX_CONST(1ffffffffffffffff);
|
596 |
|
|
#endif
|
597 |
|
|
#if LLONG_AT_LEAST(66)
|
598 |
|
|
CHECK_OCT_CONST(04000000000000000000000);
|
599 |
|
|
CHECK_HEX_CONST(20000000000000000);
|
600 |
|
|
CHECK_OCT_CONST(07777777777777777777777);
|
601 |
|
|
CHECK_HEX_CONST(3ffffffffffffffff);
|
602 |
|
|
#endif
|
603 |
|
|
#if LLONG_AT_LEAST(67)
|
604 |
|
|
CHECK_OCT_CONST(010000000000000000000000);
|
605 |
|
|
CHECK_HEX_CONST(40000000000000000);
|
606 |
|
|
CHECK_OCT_CONST(017777777777777777777777);
|
607 |
|
|
CHECK_HEX_CONST(7ffffffffffffffff);
|
608 |
|
|
#endif
|
609 |
|
|
#if LLONG_AT_LEAST(68)
|
610 |
|
|
CHECK_OCT_CONST(020000000000000000000000);
|
611 |
|
|
CHECK_HEX_CONST(80000000000000000);
|
612 |
|
|
CHECK_OCT_CONST(037777777777777777777777);
|
613 |
|
|
CHECK_HEX_CONST(fffffffffffffffff);
|
614 |
|
|
#endif
|
615 |
|
|
#if LLONG_AT_LEAST(69)
|
616 |
|
|
CHECK_OCT_CONST(040000000000000000000000);
|
617 |
|
|
CHECK_HEX_CONST(100000000000000000);
|
618 |
|
|
CHECK_OCT_CONST(077777777777777777777777);
|
619 |
|
|
CHECK_HEX_CONST(1fffffffffffffffff);
|
620 |
|
|
#endif
|
621 |
|
|
#if LLONG_AT_LEAST(70)
|
622 |
|
|
CHECK_OCT_CONST(0100000000000000000000000);
|
623 |
|
|
CHECK_HEX_CONST(200000000000000000);
|
624 |
|
|
CHECK_OCT_CONST(0177777777777777777777777);
|
625 |
|
|
CHECK_HEX_CONST(3fffffffffffffffff);
|
626 |
|
|
#endif
|
627 |
|
|
#if LLONG_AT_LEAST(71)
|
628 |
|
|
CHECK_OCT_CONST(0200000000000000000000000);
|
629 |
|
|
CHECK_HEX_CONST(400000000000000000);
|
630 |
|
|
CHECK_OCT_CONST(0377777777777777777777777);
|
631 |
|
|
CHECK_HEX_CONST(7fffffffffffffffff);
|
632 |
|
|
#endif
|
633 |
|
|
#if LLONG_AT_LEAST(72)
|
634 |
|
|
CHECK_OCT_CONST(0400000000000000000000000);
|
635 |
|
|
CHECK_HEX_CONST(800000000000000000);
|
636 |
|
|
CHECK_OCT_CONST(0777777777777777777777777);
|
637 |
|
|
CHECK_HEX_CONST(ffffffffffffffffff);
|
638 |
|
|
#endif
|
639 |
|
|
}
|