summaryrefslogtreecommitdiff
path: root/gmp/tests/t-constants.c
diff options
context:
space:
mode:
Diffstat (limited to 'gmp/tests/t-constants.c')
-rw-r--r--gmp/tests/t-constants.c65
1 files changed, 33 insertions, 32 deletions
diff --git a/gmp/tests/t-constants.c b/gmp/tests/t-constants.c
index 8583ccd4d6..ef63c09c99 100644
--- a/gmp/tests/t-constants.c
+++ b/gmp/tests/t-constants.c
@@ -1,21 +1,21 @@
/* Check the values of some constants.
-Copyright 2000-2003, 2014 Free Software Foundation, Inc.
+Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-This file is part of the GNU MP Library test suite.
+This file is part of the GNU MP Library.
-The GNU MP Library test suite is free software; you can redistribute it
-and/or modify it under the terms of the GNU General Public License as
-published by the Free Software Foundation; either version 3 of the License,
-or (at your option) any later version.
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
-The GNU MP Library test suite is distributed in the hope that it will be
-useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-Public License for more details.
+The GNU MP Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
-You should have received a copy of the GNU General Public License along with
-the GNU MP Library test suite. If not, see https://www.gnu.org/licenses/. */
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */
#include <stdio.h>
#include <stdlib.h>
@@ -24,36 +24,36 @@ the GNU MP Library test suite. If not, see https://www.gnu.org/licenses/. */
#ifdef ULONG_MAX
-const char *ulong_max_def = "defined";
+char *ulong_max_def = "defined";
#else
-const char *ulong_max_def = "not defined";
+char *ulong_max_def = "not defined";
#endif
#ifdef LONG_MAX
-const char *long_max_def = "defined";
+char *long_max_def = "defined";
#else
-const char *long_max_def = "not defined";
+char *long_max_def = "not defined";
#endif
#ifdef UINT_MAX
-const char *uint_max_def = "defined";
+char *uint_max_def = "defined";
#else
-const char *uint_max_def = "not defined";
+char *uint_max_def = "not defined";
#endif
#ifdef INT_MAX
-const char *int_max_def = "defined";
+char *int_max_def = "defined";
#else
-const char *int_max_def = "not defined";
+char *int_max_def = "not defined";
#endif
#ifdef USHRT_MAX
-const char *ushrt_max_def = "defined";
+char *ushrt_max_def = "defined";
#else
-const char *ushrt_max_def = "not defined";
+char *ushrt_max_def = "not defined";
#endif
#ifdef SHRT_MAX
-const char *shrt_max_def = "defined";
+char *shrt_max_def = "defined";
#else
-const char *shrt_max_def = "not defined";
+char *shrt_max_def = "not defined";
#endif
#include "gmp-impl.h"
@@ -208,18 +208,19 @@ main (int argc, char *argv[])
{
int error = 0;
- CHECK_INT (GMP_LIMB_BYTES, (int) sizeof(mp_limb_t));
- CHECK_INT (mp_bits_per_limb, GMP_LIMB_BITS);
+ CHECK_INT (BYTES_PER_MP_LIMB, (int) sizeof(mp_limb_t));
+ CHECK_INT (mp_bits_per_limb, BITS_PER_MP_LIMB);
+ CHECK_INT (__GMP_BITS_PER_MP_LIMB, BITS_PER_MP_LIMB);
- CHECK_BITS (GMP_LIMB_BITS, mp_limb_t);
+ CHECK_BITS (BITS_PER_MP_LIMB, mp_limb_t);
CHECK_BITS (BITS_PER_ULONG, unsigned long);
CHECK_HIGHBIT (GMP_LIMB_HIGHBIT, mp_limb_t, LL("0x%lX","0x%llX"));
CHECK_HIGHBIT (ULONG_HIGHBIT, unsigned long, "0x%lX");
CHECK_HIGHBIT (UINT_HIGHBIT, unsigned int, "0x%X");
CHECK_HIGHBIT (USHRT_HIGHBIT, unsigned short, "0x%hX");
-#if 0 /* Bad! */
CHECK_HIGHBIT (LONG_HIGHBIT, long, "0x%lX");
+#if 0 /* Bad! */
CHECK_HIGHBIT (INT_HIGHBIT, int, "0x%X");
CHECK_HIGHBIT (SHRT_HIGHBIT, short, "0x%hX");
#endif
@@ -329,10 +330,10 @@ main (int argc, char *argv[])
printf ("INT_MAX %X\n", INT_MAX);
printf ("INT_MIN %X\n", INT_MIN);
- printf ("USHRT_MAX %X\n", USHRT_MAX);
- printf ("USHRT_HIGHBIT %X\n", USHRT_HIGHBIT);
- printf ("SHRT_MAX %X\n", SHRT_MAX);
- printf ("SHRT_MIN %X\n", SHRT_MIN);
+ printf ("USHRT_MAX %hX\n", USHRT_MAX);
+ printf ("USHRT_HIGHBIT %hX\n", USHRT_HIGHBIT);
+ printf ("SHRT_MAX %hX\n", SHRT_MAX);
+ printf ("SHRT_MIN %hX\n", SHRT_MIN);
printf ("\n");
printf ("Bits\n");