Mercurial > hg > octave-lojdl > gnulib-hg
annotate tests/test-stdint.c @ 9309:bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 07 Oct 2007 19:14:58 +0200 |
parents | 633babea5f62 |
children | 22aa2c7c5a43 |
rev | line source |
---|---|
6825 | 1 /* Test of <stdint.h> substitute. |
7888
b6376840b47b
* modules/fnmatch (Depends-on): Depend on wchar.
Eric Blake <ebb9@byu.net>
parents:
7139
diff
changeset
|
2 Copyright (C) 2006, 2007 Free Software Foundation, Inc. |
6825 | 3 |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8891
diff
changeset
|
4 This program is free software: you can redistribute it and/or modify |
7139
adb21c293305
Add copyright notices to long-enough files that lack them, since
Paul Eggert <eggert@cs.ucla.edu>
parents:
6906
diff
changeset
|
5 it under the terms of the GNU General Public License as published by |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8891
diff
changeset
|
6 the Free Software Foundation; either version 3 of the License, or |
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8891
diff
changeset
|
7 (at your option) any later version. |
6825 | 8 |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
7139
adb21c293305
Add copyright notices to long-enough files that lack them, since
Paul Eggert <eggert@cs.ucla.edu>
parents:
6906
diff
changeset
|
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
adb21c293305
Add copyright notices to long-enough files that lack them, since
Paul Eggert <eggert@cs.ucla.edu>
parents:
6906
diff
changeset
|
12 GNU General Public License for more details. |
6825 | 13 |
7139
adb21c293305
Add copyright notices to long-enough files that lack them, since
Paul Eggert <eggert@cs.ucla.edu>
parents:
6906
diff
changeset
|
14 You should have received a copy of the GNU General Public License |
9309
bbbbbf4cd1c5
Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
8891
diff
changeset
|
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
6825 | 16 |
17 /* Written by Bruno Haible <bruno@clisp.org>, 2006. */ | |
18 | |
8891
633babea5f62
Unconditionally include <config.h> in unit tests.
Eric Blake <ebb9@byu.net>
parents:
7888
diff
changeset
|
19 #include <config.h> |
6825 | 20 |
21 /* Whether to enable pedantic checks. */ | |
22 #define DO_PEDANTIC 0 | |
23 | |
24 #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */ | |
25 #include <stdint.h> | |
26 | |
27 #include "verify.h" | |
28 #include "intprops.h" | |
29 | |
30 #if __GNUC__ >= 2 && DO_PEDANTIC | |
31 # define verify_same_types(expr1,expr2) \ | |
32 extern void _verify_func(__LINE__) (__typeof__ (expr1) *); \ | |
33 extern void _verify_func(__LINE__) (__typeof__ (expr2) *); | |
34 # define _verify_func(line) _verify_func2(line) | |
35 # define _verify_func2(line) verify_func_ ## line | |
36 #else | |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
37 # define verify_same_types(expr1,expr2) extern void verify_func (int) |
6825 | 38 #endif |
39 | |
40 /* 7.18.1.1. Exact-width integer types */ | |
41 /* 7.18.2.1. Limits of exact-width integer types */ | |
42 | |
43 int8_t a1[3] = { INT8_C (17), INT8_MIN, INT8_MAX }; | |
44 verify (TYPE_MINIMUM (int8_t) == INT8_MIN); | |
45 verify (TYPE_MAXIMUM (int8_t) == INT8_MAX); | |
46 verify_same_types (INT8_MIN, (int8_t) 0 + 0); | |
47 verify_same_types (INT8_MAX, (int8_t) 0 + 0); | |
48 | |
49 int16_t a2[3] = { INT16_C (17), INT16_MIN, INT16_MAX }; | |
50 verify (TYPE_MINIMUM (int16_t) == INT16_MIN); | |
51 verify (TYPE_MAXIMUM (int16_t) == INT16_MAX); | |
52 verify_same_types (INT16_MIN, (int16_t) 0 + 0); | |
53 verify_same_types (INT16_MAX, (int16_t) 0 + 0); | |
54 | |
55 int32_t a3[3] = { INT32_C (17), INT32_MIN, INT32_MAX }; | |
56 verify (TYPE_MINIMUM (int32_t) == INT32_MIN); | |
57 verify (TYPE_MAXIMUM (int32_t) == INT32_MAX); | |
58 verify_same_types (INT32_MIN, (int32_t) 0 + 0); | |
59 verify_same_types (INT32_MAX, (int32_t) 0 + 0); | |
60 | |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
61 #ifdef INT64_MAX |
6825 | 62 int64_t a4[3] = { INT64_C (17), INT64_MIN, INT64_MAX }; |
63 verify (TYPE_MINIMUM (int64_t) == INT64_MIN); | |
64 verify (TYPE_MAXIMUM (int64_t) == INT64_MAX); | |
65 verify_same_types (INT64_MIN, (int64_t) 0 + 0); | |
66 verify_same_types (INT64_MAX, (int64_t) 0 + 0); | |
67 #endif | |
68 | |
69 uint8_t b1[2] = { UINT8_C (17), UINT8_MAX }; | |
70 verify (TYPE_MAXIMUM (uint8_t) == UINT8_MAX); | |
71 verify_same_types (UINT8_MAX, (uint8_t) 0 + 0); | |
72 | |
73 uint16_t b2[2] = { UINT16_C (17), UINT16_MAX }; | |
74 verify (TYPE_MAXIMUM (uint16_t) == UINT16_MAX); | |
75 verify_same_types (UINT16_MAX, (uint16_t) 0 + 0); | |
76 | |
77 uint32_t b3[2] = { UINT32_C (17), UINT32_MAX }; | |
78 verify (TYPE_MAXIMUM (uint32_t) == UINT32_MAX); | |
79 verify_same_types (UINT32_MAX, (uint32_t) 0 + 0); | |
80 | |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
81 #ifdef UINT64_MAX |
6825 | 82 uint64_t b4[2] = { UINT64_C (17), UINT64_MAX }; |
83 verify (TYPE_MAXIMUM (uint64_t) == UINT64_MAX); | |
84 verify_same_types (UINT64_MAX, (uint64_t) 0 + 0); | |
85 #endif | |
86 | |
87 #if INT8_MIN && INT8_MAX && INT16_MIN && INT16_MAX && INT32_MIN && INT32_MAX | |
88 /* ok */ | |
89 #else | |
90 err or; | |
91 #endif | |
92 | |
93 #if UINT8_MAX && UINT16_MAX && UINT32_MAX | |
94 /* ok */ | |
95 #else | |
96 err or; | |
97 #endif | |
98 | |
99 /* 7.18.1.2. Minimum-width integer types */ | |
100 /* 7.18.2.2. Limits of minimum-width integer types */ | |
101 | |
102 int_least8_t c1[3] = { 17, INT_LEAST8_MIN, INT_LEAST8_MAX }; | |
103 verify (TYPE_MINIMUM (int_least8_t) == INT_LEAST8_MIN); | |
104 verify (TYPE_MAXIMUM (int_least8_t) == INT_LEAST8_MAX); | |
105 verify_same_types (INT_LEAST8_MIN, (int_least8_t) 0 + 0); | |
106 verify_same_types (INT_LEAST8_MAX, (int_least8_t) 0 + 0); | |
107 | |
108 int_least16_t c2[3] = { 17, INT_LEAST16_MIN, INT_LEAST16_MAX }; | |
109 verify (TYPE_MINIMUM (int_least16_t) == INT_LEAST16_MIN); | |
110 verify (TYPE_MAXIMUM (int_least16_t) == INT_LEAST16_MAX); | |
111 verify_same_types (INT_LEAST16_MIN, (int_least16_t) 0 + 0); | |
112 verify_same_types (INT_LEAST16_MAX, (int_least16_t) 0 + 0); | |
113 | |
114 int_least32_t c3[3] = { 17, INT_LEAST32_MIN, INT_LEAST32_MAX }; | |
115 verify (TYPE_MINIMUM (int_least32_t) == INT_LEAST32_MIN); | |
116 verify (TYPE_MAXIMUM (int_least32_t) == INT_LEAST32_MAX); | |
117 verify_same_types (INT_LEAST32_MIN, (int_least32_t) 0 + 0); | |
118 verify_same_types (INT_LEAST32_MAX, (int_least32_t) 0 + 0); | |
119 | |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
120 #ifdef INT_LEAST64_MAX |
6825 | 121 int_least64_t c4[3] = { 17, INT_LEAST64_MIN, INT_LEAST64_MAX }; |
122 verify (TYPE_MINIMUM (int_least64_t) == INT_LEAST64_MIN); | |
123 verify (TYPE_MAXIMUM (int_least64_t) == INT_LEAST64_MAX); | |
124 verify_same_types (INT_LEAST64_MIN, (int_least64_t) 0 + 0); | |
125 verify_same_types (INT_LEAST64_MAX, (int_least64_t) 0 + 0); | |
126 #endif | |
127 | |
128 uint_least8_t d1[2] = { 17, UINT_LEAST8_MAX }; | |
129 verify (TYPE_MAXIMUM (uint_least8_t) == UINT_LEAST8_MAX); | |
130 verify_same_types (UINT_LEAST8_MAX, (uint_least8_t) 0 + 0); | |
131 | |
132 uint_least16_t d2[2] = { 17, UINT_LEAST16_MAX }; | |
133 verify (TYPE_MAXIMUM (uint_least16_t) == UINT_LEAST16_MAX); | |
134 verify_same_types (UINT_LEAST16_MAX, (uint_least16_t) 0 + 0); | |
135 | |
136 uint_least32_t d3[2] = { 17, UINT_LEAST32_MAX }; | |
137 verify (TYPE_MAXIMUM (uint_least32_t) == UINT_LEAST32_MAX); | |
138 verify_same_types (UINT_LEAST32_MAX, (uint_least32_t) 0 + 0); | |
139 | |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
140 #ifdef UINT_LEAST64_MAX |
6825 | 141 uint_least64_t d4[2] = { 17, UINT_LEAST64_MAX }; |
142 verify (TYPE_MAXIMUM (uint_least64_t) == UINT_LEAST64_MAX); | |
143 verify_same_types (UINT_LEAST64_MAX, (uint_least64_t) 0 + 0); | |
144 #endif | |
145 | |
146 #if INT_LEAST8_MIN && INT_LEAST8_MAX && INT_LEAST16_MIN && INT_LEAST16_MAX && INT_LEAST32_MIN && INT_LEAST32_MAX | |
147 /* ok */ | |
148 #else | |
149 err or; | |
150 #endif | |
151 | |
152 #if UINT_LEAST8_MAX && UINT_LEAST16_MAX && UINT_LEAST32_MAX | |
153 /* ok */ | |
154 #else | |
155 err or; | |
156 #endif | |
157 | |
158 /* 7.18.1.3. Fastest minimum-width integer types */ | |
159 /* 7.18.2.3. Limits of fastest minimum-width integer types */ | |
160 | |
161 int_fast8_t e1[3] = { 17, INT_FAST8_MIN, INT_FAST8_MAX }; | |
162 verify (TYPE_MINIMUM (int_fast8_t) == INT_FAST8_MIN); | |
163 verify (TYPE_MAXIMUM (int_fast8_t) == INT_FAST8_MAX); | |
164 verify_same_types (INT_FAST8_MIN, (int_fast8_t) 0 + 0); | |
165 verify_same_types (INT_FAST8_MAX, (int_fast8_t) 0 + 0); | |
166 | |
167 int_fast16_t e2[3] = { 17, INT_FAST16_MIN, INT_FAST16_MAX }; | |
168 verify (TYPE_MINIMUM (int_fast16_t) == INT_FAST16_MIN); | |
169 verify (TYPE_MAXIMUM (int_fast16_t) == INT_FAST16_MAX); | |
170 verify_same_types (INT_FAST16_MIN, (int_fast16_t) 0 + 0); | |
171 verify_same_types (INT_FAST16_MAX, (int_fast16_t) 0 + 0); | |
172 | |
173 int_fast32_t e3[3] = { 17, INT_FAST32_MIN, INT_FAST32_MAX }; | |
174 verify (TYPE_MINIMUM (int_fast32_t) == INT_FAST32_MIN); | |
175 verify (TYPE_MAXIMUM (int_fast32_t) == INT_FAST32_MAX); | |
176 verify_same_types (INT_FAST32_MIN, (int_fast32_t) 0 + 0); | |
177 verify_same_types (INT_FAST32_MAX, (int_fast32_t) 0 + 0); | |
178 | |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
179 #ifdef INT_FAST64_MAX |
6825 | 180 int_fast64_t e4[3] = { 17, INT_FAST64_MIN, INT_FAST64_MAX }; |
181 verify (TYPE_MINIMUM (int_fast64_t) == INT_FAST64_MIN); | |
182 verify (TYPE_MAXIMUM (int_fast64_t) == INT_FAST64_MAX); | |
183 verify_same_types (INT_FAST64_MIN, (int_fast64_t) 0 + 0); | |
184 verify_same_types (INT_FAST64_MAX, (int_fast64_t) 0 + 0); | |
185 #endif | |
186 | |
187 uint_fast8_t f1[2] = { 17, UINT_FAST8_MAX }; | |
188 verify (TYPE_MAXIMUM (uint_fast8_t) == UINT_FAST8_MAX); | |
189 verify_same_types (UINT_FAST8_MAX, (uint_fast8_t) 0 + 0); | |
190 | |
191 uint_fast16_t f2[2] = { 17, UINT_FAST16_MAX }; | |
192 verify (TYPE_MAXIMUM (uint_fast16_t) == UINT_FAST16_MAX); | |
193 verify_same_types (UINT_FAST16_MAX, (uint_fast16_t) 0 + 0); | |
194 | |
195 uint_fast32_t f3[2] = { 17, UINT_FAST32_MAX }; | |
196 verify (TYPE_MAXIMUM (uint_fast32_t) == UINT_FAST32_MAX); | |
197 verify_same_types (UINT_FAST32_MAX, (uint_fast32_t) 0 + 0); | |
198 | |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
199 #ifdef UINT_FAST64_MAX |
6825 | 200 uint_fast64_t f4[2] = { 17, UINT_FAST64_MAX }; |
201 verify (TYPE_MAXIMUM (uint_fast64_t) == UINT_FAST64_MAX); | |
202 verify_same_types (UINT_FAST64_MAX, (uint_fast64_t) 0 + 0); | |
203 #endif | |
204 | |
205 #if INT_FAST8_MIN && INT_FAST8_MAX && INT_FAST16_MIN && INT_FAST16_MAX && INT_FAST32_MIN && INT_FAST32_MAX | |
206 /* ok */ | |
207 #else | |
208 err or; | |
209 #endif | |
210 | |
211 #if UINT_FAST8_MAX && UINT_FAST16_MAX && UINT_FAST32_MAX | |
212 /* ok */ | |
213 #else | |
214 err or; | |
215 #endif | |
216 | |
217 /* 7.18.1.4. Integer types capable of holding object pointers */ | |
218 /* 7.18.2.4. Limits of integer types capable of holding object pointers */ | |
219 | |
220 intptr_t g[3] = { 17, INTPTR_MIN, INTPTR_MAX }; | |
221 verify (TYPE_MINIMUM (intptr_t) == INTPTR_MIN); | |
222 verify (TYPE_MAXIMUM (intptr_t) == INTPTR_MAX); | |
223 verify_same_types (INTPTR_MIN, (intptr_t) 0 + 0); | |
224 verify_same_types (INTPTR_MAX, (intptr_t) 0 + 0); | |
225 | |
226 uintptr_t h[2] = { 17, UINTPTR_MAX }; | |
227 verify (TYPE_MAXIMUM (uintptr_t) == UINTPTR_MAX); | |
228 verify_same_types (UINTPTR_MAX, (uintptr_t) 0 + 0); | |
229 | |
230 #if INTPTR_MIN && INTPTR_MAX && UINTPTR_MAX | |
231 /* ok */ | |
232 #else | |
233 err or; | |
234 #endif | |
235 | |
236 /* 7.18.1.5. Greatest-width integer types */ | |
237 /* 7.18.2.5. Limits of greatest-width integer types */ | |
238 | |
239 intmax_t i[3] = { INTMAX_C (17), INTMAX_MIN, INTMAX_MAX }; | |
240 verify (TYPE_MINIMUM (intmax_t) == INTMAX_MIN); | |
241 verify (TYPE_MAXIMUM (intmax_t) == INTMAX_MAX); | |
242 verify_same_types (INTMAX_MIN, (intmax_t) 0 + 0); | |
243 verify_same_types (INTMAX_MAX, (intmax_t) 0 + 0); | |
244 | |
245 uintmax_t j[2] = { UINTMAX_C (17), UINTMAX_MAX }; | |
246 verify (TYPE_MAXIMUM (uintmax_t) == UINTMAX_MAX); | |
247 verify_same_types (UINTMAX_MAX, (uintmax_t) 0 + 0); | |
248 | |
249 #if INTMAX_MIN && INTMAX_MAX && UINTMAX_MAX | |
250 /* ok */ | |
251 #else | |
252 err or; | |
253 #endif | |
254 | |
255 /* 7.18.3. Limits of other integer types */ | |
256 | |
257 #include <stddef.h> | |
258 | |
259 verify (TYPE_MINIMUM (ptrdiff_t) == PTRDIFF_MIN); | |
260 verify (TYPE_MAXIMUM (ptrdiff_t) == PTRDIFF_MAX); | |
261 verify_same_types (PTRDIFF_MIN, (ptrdiff_t) 0 + 0); | |
262 verify_same_types (PTRDIFF_MAX, (ptrdiff_t) 0 + 0); | |
263 | |
264 #if PTRDIFF_MIN && PTRDIFF_MAX | |
265 /* ok */ | |
266 #else | |
267 err or; | |
268 #endif | |
269 | |
270 #include <signal.h> | |
271 | |
272 verify (TYPE_MINIMUM (sig_atomic_t) == SIG_ATOMIC_MIN); | |
273 verify (TYPE_MAXIMUM (sig_atomic_t) == SIG_ATOMIC_MAX); | |
274 verify_same_types (SIG_ATOMIC_MIN, (sig_atomic_t) 0 + 0); | |
275 verify_same_types (SIG_ATOMIC_MAX, (sig_atomic_t) 0 + 0); | |
276 | |
277 #if SIG_ATOMIC_MIN != 17 && SIG_ATOMIC_MAX | |
278 /* ok */ | |
279 #else | |
280 err or; | |
281 #endif | |
282 | |
283 verify (TYPE_MAXIMUM (size_t) == SIZE_MAX); | |
284 verify_same_types (SIZE_MAX, (size_t) 0 + 0); | |
285 | |
286 #if SIZE_MAX | |
287 /* ok */ | |
288 #else | |
289 err or; | |
290 #endif | |
291 | |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
292 #if HAVE_WCHAR_T |
6825 | 293 verify (TYPE_MINIMUM (wchar_t) == WCHAR_MIN); |
294 verify (TYPE_MAXIMUM (wchar_t) == WCHAR_MAX); | |
295 verify_same_types (WCHAR_MIN, (wchar_t) 0 + 0); | |
296 verify_same_types (WCHAR_MAX, (wchar_t) 0 + 0); | |
297 | |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
298 # if WCHAR_MIN != 17 && WCHAR_MAX |
6825 | 299 /* ok */ |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
300 # else |
6825 | 301 err or; |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
302 # endif |
6825 | 303 #endif |
304 | |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
305 #if HAVE_WINT_T |
7888
b6376840b47b
* modules/fnmatch (Depends-on): Depend on wchar.
Eric Blake <ebb9@byu.net>
parents:
7139
diff
changeset
|
306 # include <wchar.h> |
6825 | 307 |
308 verify (TYPE_MINIMUM (wint_t) == WINT_MIN); | |
309 verify (TYPE_MAXIMUM (wint_t) == WINT_MAX); | |
310 verify_same_types (WINT_MIN, (wint_t) 0 + 0); | |
311 verify_same_types (WINT_MAX, (wint_t) 0 + 0); | |
312 | |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
313 # if WINT_MIN != 17 && WINT_MAX |
6825 | 314 /* ok */ |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
315 # else |
6825 | 316 err or; |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
317 # endif |
6825 | 318 #endif |
319 | |
320 /* 7.18.4. Macros for integer constants */ | |
321 | |
322 verify (INT8_C (17) == 17); | |
6861
b82bca6af622
Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents:
6825
diff
changeset
|
323 verify_same_types (INT8_C (17), (int_least8_t)0 + 0); |
6825 | 324 verify (UINT8_C (17) == 17); |
6861
b82bca6af622
Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents:
6825
diff
changeset
|
325 verify_same_types (UINT8_C (17), (uint_least8_t)0 + 0); |
6825 | 326 |
327 verify (INT16_C (17) == 17); | |
6861
b82bca6af622
Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents:
6825
diff
changeset
|
328 verify_same_types (INT16_C (17), (int_least16_t)0 + 0); |
6825 | 329 verify (UINT16_C (17) == 17); |
6861
b82bca6af622
Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents:
6825
diff
changeset
|
330 verify_same_types (UINT16_C (17), (uint_least16_t)0 + 0); |
6825 | 331 |
332 verify (INT32_C (17) == 17); | |
6861
b82bca6af622
Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents:
6825
diff
changeset
|
333 verify_same_types (INT32_C (17), (int_least32_t)0 + 0); |
6825 | 334 verify (UINT32_C (17) == 17); |
6861
b82bca6af622
Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents:
6825
diff
changeset
|
335 verify_same_types (UINT32_C (17), (uint_least32_t)0 + 0); |
6825 | 336 |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
337 #ifdef INT64_C |
6825 | 338 verify (INT64_C (17) == 17); |
6861
b82bca6af622
Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents:
6825
diff
changeset
|
339 verify_same_types (INT64_C (17), (int_least64_t)0 + 0); |
6825 | 340 #endif |
6906
b912515df187
Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents:
6861
diff
changeset
|
341 #ifdef UINT64_C |
6825 | 342 verify (UINT64_C (17) == 17); |
6861
b82bca6af622
Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents:
6825
diff
changeset
|
343 verify_same_types (UINT64_C (17), (uint_least64_t)0 + 0); |
6825 | 344 #endif |
345 | |
346 verify (INTMAX_C (17) == 17); | |
6861
b82bca6af622
Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents:
6825
diff
changeset
|
347 verify_same_types (INTMAX_C (17), (intmax_t)0 + 0); |
6825 | 348 verify (UINTMAX_C (17) == 17); |
6861
b82bca6af622
Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents:
6825
diff
changeset
|
349 verify_same_types (UINTMAX_C (17), (uintmax_t)0 + 0); |
6825 | 350 |
351 | |
352 int | |
353 main () | |
354 { | |
355 return 0; | |
356 } |