1 /* Check the values of __GMP_UINT_MAX etc.
3 Copyright 2001 Free Software Foundation, Inc.
5 This file is part of the GNU MP Library.
7 The GNU MP Library is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
12 The GNU MP Library is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 License for more details.
17 You should have received a copy of the GNU Lesser General Public License
18 along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
26 /* __GMP_UINT_MAX etc are generated with expressions in gmp.h since we don't
27 want to demand <limits.h> or forcibly include it. Check the expressions
28 come out the same as <limits.h>. */
31 main (int argc, char *argv[])
36 if (__GMP_UINT_MAX != UINT_MAX)
38 printf ("__GMP_UINT_MAX incorrect\n");
39 printf (" __GMP_UINT_MAX %u 0x%X\n", __GMP_UINT_MAX, __GMP_UINT_MAX);
40 printf (" UINT_MAX %u 0x%X\n", UINT_MAX, UINT_MAX);
45 /* gcc 2.95.2 limits.h on solaris 2.5.1 incorrectly selects a 64-bit
46 LONG_MAX, leading to some integer overflow in ULONG_MAX and a spurious
47 __GMP_ULONG_MAX != ULONG_MAX. Casting ULONG_MAX to unsigned long is a
50 if (__GMP_ULONG_MAX != (unsigned long) ULONG_MAX)
52 printf ("__GMP_ULONG_MAX incorrect\n");
53 printf (" __GMP_ULONG_MAX %lu 0x%lX\n", __GMP_ULONG_MAX, __GMP_ULONG_MAX);
54 printf (" ULONG_MAX %lu 0x%lX\n", ULONG_MAX, ULONG_MAX);
60 if (__GMP_USHRT_MAX != USHRT_MAX)
62 printf ("__GMP_USHRT_MAX incorrect\n");
63 printf (" __GMP_USHRT_MAX %hu 0x%hX\n", __GMP_USHRT_MAX, __GMP_USHRT_MAX);
64 printf (" USHRT_MAX %hu 0x%hX\n", USHRT_MAX, USHRT_MAX);