1 /* Test of <limits.h> substitute.
2 Copyright 2016-2018 Free Software Foundation, Inc.
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
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
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
16
17 /* Written by Paul Eggert. */
18
19 #include <config.h>
20
21 #include <limits.h>
22
23 #include "verify.h"
24
25 #if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
26 # pragma GCC diagnostic ignored "-Woverlength-strings"
27 #endif
28
29 /* Macros specified by ISO/IEC TS 18661-1:2014. */
30
31 #define verify_width(width, min, max) \
32 verify ((max) >> ((width) - 1 - ((min) < 0)) == 1)
33
34 verify_width (CHAR_WIDTH, CHAR_MIN, CHAR_MAX);
35 verify_width (SCHAR_WIDTH, SCHAR_MIN, SCHAR_MAX);
36 verify_width (UCHAR_WIDTH, 0, UCHAR_MAX);
37 verify_width (SHRT_WIDTH, SHRT_MIN, SHRT_MAX);
38 verify_width (USHRT_WIDTH, 0, USHRT_MAX);
39 verify_width (INT_WIDTH, INT_MIN, INT_MAX);
40 verify_width (UINT_WIDTH, 0, UINT_MAX);
41 verify_width (LONG_WIDTH, LONG_MIN, LONG_MAX);
42 verify_width (ULONG_WIDTH, 0, ULONG_MAX);
43 verify_width (LLONG_WIDTH, LLONG_MIN, LLONG_MAX);
44 verify_width (ULLONG_WIDTH, 0, ULLONG_MAX);
45
46 int
main(void)47 main (void)
48 {
49 return 0;
50 }
51