annotate tests/test-stdint.c @ 40231:9b3c79fdfe0b

strtod: fix clash with strtold Problem reported for RHEL 5 by Jesse Caldwell (Bug#34817). * lib/strtod.c (compute_minus_zero, minus_zero): Simplify by remving the macro / external variable, and having just a function. User changed. This avoids the need for an external variable that might clash.
author Paul Eggert <eggert@cs.ucla.edu>
date Mon, 11 Mar 2019 16:40:29 -0700
parents b06060465f09
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Test of <stdint.h> substitute.
40057
b06060465f09 maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents: 19484
diff changeset
2 Copyright (C) 2006-2019 Free Software Foundation, Inc.
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
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
19190
9759915b2aca all: prefer https: URLs
Paul Eggert <eggert@cs.ucla.edu>
parents: 18626
diff changeset
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* Written by Bruno Haible <bruno@clisp.org>, 2006. */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
8891
633babea5f62 Unconditionally include <config.h> in unit tests.
Eric Blake <ebb9@byu.net>
parents: 7888
diff changeset
19 #include <config.h>
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 /* Whether to enable pedantic checks. */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 #define DO_PEDANTIC 0
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 #include <stdint.h>
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 #include "verify.h"
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 #include "intprops.h"
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 #if __GNUC__ >= 2 && DO_PEDANTIC
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 # define verify_same_types(expr1,expr2) \
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 extern void _verify_func(__LINE__) (__typeof__ (expr1) *); \
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 extern void _verify_func(__LINE__) (__typeof__ (expr2) *);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 # define _verify_func(line) _verify_func2(line)
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 # define _verify_func2(line) verify_func_ ## line
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 #else
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
36 # define verify_same_types(expr1,expr2) extern void verify_func (int)
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 /* 7.18.1.1. Exact-width integer types */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 /* 7.18.2.1. Limits of exact-width integer types */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 int8_t a1[3] = { INT8_C (17), INT8_MIN, INT8_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 verify (TYPE_MINIMUM (int8_t) == INT8_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 verify (TYPE_MAXIMUM (int8_t) == INT8_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 verify_same_types (INT8_MIN, (int8_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 verify_same_types (INT8_MAX, (int8_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 int16_t a2[3] = { INT16_C (17), INT16_MIN, INT16_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 verify (TYPE_MINIMUM (int16_t) == INT16_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 verify (TYPE_MAXIMUM (int16_t) == INT16_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 verify_same_types (INT16_MIN, (int16_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 verify_same_types (INT16_MAX, (int16_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 int32_t a3[3] = { INT32_C (17), INT32_MIN, INT32_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 verify (TYPE_MINIMUM (int32_t) == INT32_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 verify (TYPE_MAXIMUM (int32_t) == INT32_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 verify_same_types (INT32_MIN, (int32_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 verify_same_types (INT32_MAX, (int32_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
60 #ifdef INT64_MAX
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 int64_t a4[3] = { INT64_C (17), INT64_MIN, INT64_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 verify (TYPE_MINIMUM (int64_t) == INT64_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 verify (TYPE_MAXIMUM (int64_t) == INT64_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 verify_same_types (INT64_MIN, (int64_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 verify_same_types (INT64_MAX, (int64_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 uint8_t b1[2] = { UINT8_C (17), UINT8_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69 verify (TYPE_MAXIMUM (uint8_t) == UINT8_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 verify_same_types (UINT8_MAX, (uint8_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 uint16_t b2[2] = { UINT16_C (17), UINT16_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73 verify (TYPE_MAXIMUM (uint16_t) == UINT16_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 verify_same_types (UINT16_MAX, (uint16_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
75
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76 uint32_t b3[2] = { UINT32_C (17), UINT32_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77 verify (TYPE_MAXIMUM (uint32_t) == UINT32_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 verify_same_types (UINT32_MAX, (uint32_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
79
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
80 #ifdef UINT64_MAX
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
81 uint64_t b4[2] = { UINT64_C (17), UINT64_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
82 verify (TYPE_MAXIMUM (uint64_t) == UINT64_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
83 verify_same_types (UINT64_MAX, (uint64_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
84 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
85
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
86 #if INT8_MIN && INT8_MAX && INT16_MIN && INT16_MAX && INT32_MIN && INT32_MAX
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87 /* ok */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88 #else
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
89 err or;
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
91
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
92 #if UINT8_MAX && UINT16_MAX && UINT32_MAX
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
93 /* ok */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
94 #else
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
95 err or;
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
96 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
97
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
98 /* 7.18.1.2. Minimum-width integer types */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
99 /* 7.18.2.2. Limits of minimum-width integer types */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
100
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
101 int_least8_t c1[3] = { 17, INT_LEAST8_MIN, INT_LEAST8_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
102 verify (TYPE_MINIMUM (int_least8_t) == INT_LEAST8_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
103 verify (TYPE_MAXIMUM (int_least8_t) == INT_LEAST8_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
104 verify_same_types (INT_LEAST8_MIN, (int_least8_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
105 verify_same_types (INT_LEAST8_MAX, (int_least8_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
106
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
107 int_least16_t c2[3] = { 17, INT_LEAST16_MIN, INT_LEAST16_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
108 verify (TYPE_MINIMUM (int_least16_t) == INT_LEAST16_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
109 verify (TYPE_MAXIMUM (int_least16_t) == INT_LEAST16_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
110 verify_same_types (INT_LEAST16_MIN, (int_least16_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
111 verify_same_types (INT_LEAST16_MAX, (int_least16_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
112
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
113 int_least32_t c3[3] = { 17, INT_LEAST32_MIN, INT_LEAST32_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
114 verify (TYPE_MINIMUM (int_least32_t) == INT_LEAST32_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
115 verify (TYPE_MAXIMUM (int_least32_t) == INT_LEAST32_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
116 verify_same_types (INT_LEAST32_MIN, (int_least32_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
117 verify_same_types (INT_LEAST32_MAX, (int_least32_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
118
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
119 #ifdef INT_LEAST64_MAX
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
120 int_least64_t c4[3] = { 17, INT_LEAST64_MIN, INT_LEAST64_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
121 verify (TYPE_MINIMUM (int_least64_t) == INT_LEAST64_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
122 verify (TYPE_MAXIMUM (int_least64_t) == INT_LEAST64_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
123 verify_same_types (INT_LEAST64_MIN, (int_least64_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
124 verify_same_types (INT_LEAST64_MAX, (int_least64_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
125 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
126
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
127 uint_least8_t d1[2] = { 17, UINT_LEAST8_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
128 verify (TYPE_MAXIMUM (uint_least8_t) == UINT_LEAST8_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
129 verify_same_types (UINT_LEAST8_MAX, (uint_least8_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
130
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
131 uint_least16_t d2[2] = { 17, UINT_LEAST16_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
132 verify (TYPE_MAXIMUM (uint_least16_t) == UINT_LEAST16_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
133 verify_same_types (UINT_LEAST16_MAX, (uint_least16_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
134
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
135 uint_least32_t d3[2] = { 17, UINT_LEAST32_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
136 verify (TYPE_MAXIMUM (uint_least32_t) == UINT_LEAST32_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
137 verify_same_types (UINT_LEAST32_MAX, (uint_least32_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
138
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
139 #ifdef UINT_LEAST64_MAX
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
140 uint_least64_t d4[2] = { 17, UINT_LEAST64_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
141 verify (TYPE_MAXIMUM (uint_least64_t) == UINT_LEAST64_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
142 verify_same_types (UINT_LEAST64_MAX, (uint_least64_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
143 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
144
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
145 #if INT_LEAST8_MIN && INT_LEAST8_MAX && INT_LEAST16_MIN && INT_LEAST16_MAX && INT_LEAST32_MIN && INT_LEAST32_MAX
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
146 /* ok */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
147 #else
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
148 err or;
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
149 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
150
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
151 #if UINT_LEAST8_MAX && UINT_LEAST16_MAX && UINT_LEAST32_MAX
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
152 /* ok */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
153 #else
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
154 err or;
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
155 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
156
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
157 /* 7.18.1.3. Fastest minimum-width integer types */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
158 /* 7.18.2.3. Limits of fastest minimum-width integer types */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
159
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
160 int_fast8_t e1[3] = { 17, INT_FAST8_MIN, INT_FAST8_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
161 verify (TYPE_MINIMUM (int_fast8_t) == INT_FAST8_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
162 verify (TYPE_MAXIMUM (int_fast8_t) == INT_FAST8_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
163 verify_same_types (INT_FAST8_MIN, (int_fast8_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
164 verify_same_types (INT_FAST8_MAX, (int_fast8_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
165
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
166 int_fast16_t e2[3] = { 17, INT_FAST16_MIN, INT_FAST16_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
167 verify (TYPE_MINIMUM (int_fast16_t) == INT_FAST16_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
168 verify (TYPE_MAXIMUM (int_fast16_t) == INT_FAST16_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
169 verify_same_types (INT_FAST16_MIN, (int_fast16_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
170 verify_same_types (INT_FAST16_MAX, (int_fast16_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
171
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
172 int_fast32_t e3[3] = { 17, INT_FAST32_MIN, INT_FAST32_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
173 verify (TYPE_MINIMUM (int_fast32_t) == INT_FAST32_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
174 verify (TYPE_MAXIMUM (int_fast32_t) == INT_FAST32_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
175 verify_same_types (INT_FAST32_MIN, (int_fast32_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
176 verify_same_types (INT_FAST32_MAX, (int_fast32_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
177
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
178 #ifdef INT_FAST64_MAX
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
179 int_fast64_t e4[3] = { 17, INT_FAST64_MIN, INT_FAST64_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
180 verify (TYPE_MINIMUM (int_fast64_t) == INT_FAST64_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
181 verify (TYPE_MAXIMUM (int_fast64_t) == INT_FAST64_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
182 verify_same_types (INT_FAST64_MIN, (int_fast64_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
183 verify_same_types (INT_FAST64_MAX, (int_fast64_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
184 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
185
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
186 uint_fast8_t f1[2] = { 17, UINT_FAST8_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
187 verify (TYPE_MAXIMUM (uint_fast8_t) == UINT_FAST8_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
188 verify_same_types (UINT_FAST8_MAX, (uint_fast8_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
189
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
190 uint_fast16_t f2[2] = { 17, UINT_FAST16_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
191 verify (TYPE_MAXIMUM (uint_fast16_t) == UINT_FAST16_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
192 verify_same_types (UINT_FAST16_MAX, (uint_fast16_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
193
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
194 uint_fast32_t f3[2] = { 17, UINT_FAST32_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
195 verify (TYPE_MAXIMUM (uint_fast32_t) == UINT_FAST32_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
196 verify_same_types (UINT_FAST32_MAX, (uint_fast32_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
197
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
198 #ifdef UINT_FAST64_MAX
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
199 uint_fast64_t f4[2] = { 17, UINT_FAST64_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
200 verify (TYPE_MAXIMUM (uint_fast64_t) == UINT_FAST64_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
201 verify_same_types (UINT_FAST64_MAX, (uint_fast64_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
202 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
203
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
204 #if INT_FAST8_MIN && INT_FAST8_MAX && INT_FAST16_MIN && INT_FAST16_MAX && INT_FAST32_MIN && INT_FAST32_MAX
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
205 /* ok */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
206 #else
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
207 err or;
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
208 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
209
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
210 #if UINT_FAST8_MAX && UINT_FAST16_MAX && UINT_FAST32_MAX
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
211 /* ok */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
212 #else
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
213 err or;
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
214 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
215
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
216 /* 7.18.1.4. Integer types capable of holding object pointers */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
217 /* 7.18.2.4. Limits of integer types capable of holding object pointers */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
218
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
219 intptr_t g[3] = { 17, INTPTR_MIN, INTPTR_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
220 verify (TYPE_MINIMUM (intptr_t) == INTPTR_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
221 verify (TYPE_MAXIMUM (intptr_t) == INTPTR_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
222 verify_same_types (INTPTR_MIN, (intptr_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
223 verify_same_types (INTPTR_MAX, (intptr_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
224
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
225 uintptr_t h[2] = { 17, UINTPTR_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
226 verify (TYPE_MAXIMUM (uintptr_t) == UINTPTR_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
227 verify_same_types (UINTPTR_MAX, (uintptr_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
228
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
229 #if INTPTR_MIN && INTPTR_MAX && UINTPTR_MAX
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
230 /* ok */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
231 #else
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
232 err or;
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
233 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
234
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
235 /* 7.18.1.5. Greatest-width integer types */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
236 /* 7.18.2.5. Limits of greatest-width integer types */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
237
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
238 intmax_t i[3] = { INTMAX_C (17), INTMAX_MIN, INTMAX_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
239 verify (TYPE_MINIMUM (intmax_t) == INTMAX_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
240 verify (TYPE_MAXIMUM (intmax_t) == INTMAX_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
241 verify_same_types (INTMAX_MIN, (intmax_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
242 verify_same_types (INTMAX_MAX, (intmax_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
243
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
244 uintmax_t j[2] = { UINTMAX_C (17), UINTMAX_MAX };
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
245 verify (TYPE_MAXIMUM (uintmax_t) == UINTMAX_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
246 verify_same_types (UINTMAX_MAX, (uintmax_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
247
10238
22aa2c7c5a43 Conditionally disable part of the test.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
248 /* As of 2007, Sun C and HP-UX 10.20 cc don't support 'long long' constants in
22aa2c7c5a43 Conditionally disable part of the test.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
249 the preprocessor. */
22aa2c7c5a43 Conditionally disable part of the test.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
250 #if !(defined __SUNPRO_C || (defined __hpux && !defined __GNUC__))
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
251 #if INTMAX_MIN && INTMAX_MAX && UINTMAX_MAX
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
252 /* ok */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
253 #else
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
254 err or;
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
255 #endif
10238
22aa2c7c5a43 Conditionally disable part of the test.
Bruno Haible <bruno@clisp.org>
parents: 9309
diff changeset
256 #endif
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
257
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
258 /* 7.18.3. Limits of other integer types */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
259
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
260 #include <stddef.h>
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
261
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
262 verify (TYPE_MINIMUM (ptrdiff_t) == PTRDIFF_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
263 verify (TYPE_MAXIMUM (ptrdiff_t) == PTRDIFF_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
264 verify_same_types (PTRDIFF_MIN, (ptrdiff_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
265 verify_same_types (PTRDIFF_MAX, (ptrdiff_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
266
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
267 #if PTRDIFF_MIN && PTRDIFF_MAX
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
268 /* ok */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
269 #else
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
270 err or;
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
271 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
272
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
273 #include <signal.h>
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
274
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
275 verify (TYPE_MINIMUM (sig_atomic_t) == SIG_ATOMIC_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
276 verify (TYPE_MAXIMUM (sig_atomic_t) == SIG_ATOMIC_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
277 verify_same_types (SIG_ATOMIC_MIN, (sig_atomic_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
278 verify_same_types (SIG_ATOMIC_MAX, (sig_atomic_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
279
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
280 #if SIG_ATOMIC_MIN != 17 && SIG_ATOMIC_MAX
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
281 /* ok */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
282 #else
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
283 err or;
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
284 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
285
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
286 verify (TYPE_MAXIMUM (size_t) == SIZE_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
287 verify_same_types (SIZE_MAX, (size_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
288
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
289 #if SIZE_MAX
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
290 /* ok */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
291 #else
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
292 err or;
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
293 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
294
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
295 #if HAVE_WCHAR_T
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
296 verify (TYPE_MINIMUM (wchar_t) == WCHAR_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
297 verify (TYPE_MAXIMUM (wchar_t) == WCHAR_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
298 verify_same_types (WCHAR_MIN, (wchar_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
299 verify_same_types (WCHAR_MAX, (wchar_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
300
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
301 # if WCHAR_MIN != 17 && WCHAR_MAX
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
302 /* ok */
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
303 # else
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
304 err or;
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
305 # endif
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
306 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
307
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
308 #if HAVE_WINT_T
7888
b6376840b47b * modules/fnmatch (Depends-on): Depend on wchar.
Eric Blake <ebb9@byu.net>
parents: 7139
diff changeset
309 # include <wchar.h>
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
310
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
311 verify (TYPE_MINIMUM (wint_t) == WINT_MIN);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
312 verify (TYPE_MAXIMUM (wint_t) == WINT_MAX);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
313 verify_same_types (WINT_MIN, (wint_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
314 verify_same_types (WINT_MAX, (wint_t) 0 + 0);
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
315
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
316 # if WINT_MIN != 17 && WINT_MAX
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
317 /* ok */
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
318 # else
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
319 err or;
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
320 # endif
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
321 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
322
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
323 /* 7.18.4. Macros for integer constants */
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
324
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
325 verify (INT8_C (17) == 17);
6861
b82bca6af622 Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents: 6825
diff changeset
326 verify_same_types (INT8_C (17), (int_least8_t)0 + 0);
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
327 verify (UINT8_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 (UINT8_C (17), (uint_least8_t)0 + 0);
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
329
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
330 verify (INT16_C (17) == 17);
6861
b82bca6af622 Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents: 6825
diff changeset
331 verify_same_types (INT16_C (17), (int_least16_t)0 + 0);
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
332 verify (UINT16_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 (UINT16_C (17), (uint_least16_t)0 + 0);
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
334
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
335 verify (INT32_C (17) == 17);
6861
b82bca6af622 Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents: 6825
diff changeset
336 verify_same_types (INT32_C (17), (int_least32_t)0 + 0);
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
337 verify (UINT32_C (17) == 17);
6861
b82bca6af622 Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents: 6825
diff changeset
338 verify_same_types (UINT32_C (17), (uint_least32_t)0 + 0);
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
339
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
340 #ifdef INT64_C
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
341 verify (INT64_C (17) == 17);
6861
b82bca6af622 Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents: 6825
diff changeset
342 verify_same_types (INT64_C (17), (int_least64_t)0 + 0);
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
343 #endif
6906
b912515df187 Simplification rewrite for stdint module.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6861
diff changeset
344 #ifdef UINT64_C
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
345 verify (UINT64_C (17) == 17);
6861
b82bca6af622 Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents: 6825
diff changeset
346 verify_same_types (UINT64_C (17), (uint_least64_t)0 + 0);
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
347 #endif
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
348
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
349 verify (INTMAX_C (17) == 17);
6861
b82bca6af622 Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents: 6825
diff changeset
350 verify_same_types (INTMAX_C (17), (intmax_t)0 + 0);
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
351 verify (UINTMAX_C (17) == 17);
6861
b82bca6af622 Take into account ISO C 99 TC1.
Bruno Haible <bruno@clisp.org>
parents: 6825
diff changeset
352 verify_same_types (UINTMAX_C (17), (uintmax_t)0 + 0);
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
353
18451
1c3086a205d3 test-stdint: use _GL_VERIFY rather than "verify" for some tests
Jim Meyering <meyering@fb.com>
parents: 18423
diff changeset
354 /* Use _GL_VERIFY (with a fixed-length diagnostic string) rather than verify,
1c3086a205d3 test-stdint: use _GL_VERIFY rather than "verify" for some tests
Jim Meyering <meyering@fb.com>
parents: 18423
diff changeset
355 because the latter would require forming each stringified expression, and
1c3086a205d3 test-stdint: use _GL_VERIFY rather than "verify" for some tests
Jim Meyering <meyering@fb.com>
parents: 18423
diff changeset
356 many of these would be so long as to trigger a warning/error like this:
18423
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
357
18451
1c3086a205d3 test-stdint: use _GL_VERIFY rather than "verify" for some tests
Jim Meyering <meyering@fb.com>
parents: 18423
diff changeset
358 test-stdint.c:407:1: error: string length '6980' is greater than the \
1c3086a205d3 test-stdint: use _GL_VERIFY rather than "verify" for some tests
Jim Meyering <meyering@fb.com>
parents: 18423
diff changeset
359 length '4095' ISO C99 compilers are required to support \
1c3086a205d3 test-stdint: use _GL_VERIFY rather than "verify" for some tests
Jim Meyering <meyering@fb.com>
parents: 18423
diff changeset
360 [-Werror=overlength-strings]
1c3086a205d3 test-stdint: use _GL_VERIFY rather than "verify" for some tests
Jim Meyering <meyering@fb.com>
parents: 18423
diff changeset
361 */
18423
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
362 #define verify_width(width, min, max) \
18451
1c3086a205d3 test-stdint: use _GL_VERIFY rather than "verify" for some tests
Jim Meyering <meyering@fb.com>
parents: 18423
diff changeset
363 _GL_VERIFY ((max) >> ((width) - 1 - ((min) < 0)) == 1, \
1c3086a205d3 test-stdint: use _GL_VERIFY rather than "verify" for some tests
Jim Meyering <meyering@fb.com>
parents: 18423
diff changeset
364 "verify_width check")
1c3086a205d3 test-stdint: use _GL_VERIFY rather than "verify" for some tests
Jim Meyering <meyering@fb.com>
parents: 18423
diff changeset
365
1c3086a205d3 test-stdint: use _GL_VERIFY rather than "verify" for some tests
Jim Meyering <meyering@fb.com>
parents: 18423
diff changeset
366 /* Macros specified by ISO/IEC TS 18661-1:2014. */
18423
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
367
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
368 #ifdef INT8_MAX
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
369 verify_width (INT8_WIDTH, INT8_MIN, INT8_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
370 #endif
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
371 #ifdef UINT8_MAX
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
372 verify_width (UINT8_WIDTH, 0, UINT8_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
373 #endif
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
374 #ifdef INT16_MAX
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
375 verify_width (INT16_WIDTH, INT16_MIN, INT16_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
376 #endif
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
377 #ifdef UINT16_MAX
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
378 verify_width (UINT16_WIDTH, 0, UINT16_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
379 #endif
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
380 #ifdef INT32_MAX
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
381 verify_width (INT32_WIDTH, INT32_MIN, INT32_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
382 #endif
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
383 #ifdef UINT32_MAX
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
384 verify_width (UINT32_WIDTH, 0, UINT32_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
385 #endif
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
386 #ifdef INT64_MAX
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
387 verify_width (INT64_WIDTH, INT64_MIN, INT64_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
388 #endif
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
389 #ifdef UINT64_MAX
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
390 verify_width (UINT64_WIDTH, 0, UINT64_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
391 #endif
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
392 verify_width (INT_LEAST8_WIDTH, INT_LEAST8_MIN, INT_LEAST8_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
393 verify_width (UINT_LEAST8_WIDTH, 0, UINT_LEAST8_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
394 verify_width (INT_LEAST16_WIDTH, INT_LEAST16_MIN, INT_LEAST16_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
395 verify_width (UINT_LEAST16_WIDTH, 0, UINT_LEAST16_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
396 verify_width (INT_LEAST32_WIDTH, INT_LEAST32_MIN, INT_LEAST32_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
397 verify_width (UINT_LEAST32_WIDTH, 0, UINT_LEAST32_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
398 verify_width (INT_LEAST64_WIDTH, INT_LEAST64_MIN, INT_LEAST64_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
399 verify_width (UINT_LEAST64_WIDTH, 0, UINT_LEAST64_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
400 verify_width (INT_FAST8_WIDTH, INT_FAST8_MIN, INT_FAST8_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
401 verify_width (UINT_FAST8_WIDTH, 0, UINT_FAST8_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
402 verify_width (INT_FAST16_WIDTH, INT_FAST16_MIN, INT_FAST16_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
403 verify_width (UINT_FAST16_WIDTH, 0, UINT_FAST16_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
404 verify_width (INT_FAST32_WIDTH, INT_FAST32_MIN, INT_FAST32_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
405 verify_width (UINT_FAST32_WIDTH, 0, UINT_FAST32_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
406 verify_width (INT_FAST64_WIDTH, INT_FAST64_MIN, INT_FAST64_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
407 verify_width (UINT_FAST64_WIDTH, 0, UINT_FAST64_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
408 verify_width (INTPTR_WIDTH, INTPTR_MIN, INTPTR_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
409 verify_width (UINTPTR_WIDTH, 0, UINTPTR_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
410 verify_width (INTMAX_WIDTH, INTMAX_MIN, INTMAX_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
411 verify_width (UINTMAX_WIDTH, 0, UINTMAX_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
412 verify_width (PTRDIFF_WIDTH, PTRDIFF_MIN, PTRDIFF_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
413 verify_width (SIZE_WIDTH, 0, SIZE_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
414 verify_width (WCHAR_WIDTH, WCHAR_MIN, WCHAR_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
415 #ifdef WINT_MAX
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
416 verify_width (WINT_WIDTH, WINT_MIN, WINT_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
417 #endif
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
418 #ifdef SIG_ATOMIC_MAX
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
419 verify_width (SIG_ATOMIC_WIDTH, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX);
670fe923ee56 stdint: support new _WIDTH macros
Paul Eggert <eggert@cs.ucla.edu>
parents: 18189
diff changeset
420 #endif
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
421
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
422 int
12197
e45d9bb2233e tests: avoid several compiler warnings
Eric Blake <ebb9@byu.net>
parents: 10238
diff changeset
423 main (void)
6825
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
424 {
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
425 return 0;
b048a64a7f04 New module 'stdint-tests'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
426 }