Blame gl/tests/test-limits-h.c

Packit 549fdc
/* Test of <limits.h> substitute.
Packit 549fdc
   Copyright 2016 Free Software Foundation, Inc.
Packit 549fdc
Packit 549fdc
   This program is free software: you can redistribute it and/or modify
Packit 549fdc
   it under the terms of the GNU General Public License as published by
Packit 549fdc
   the Free Software Foundation; either version 3 of the License, or
Packit 549fdc
   (at your option) any later version.
Packit 549fdc
Packit 549fdc
   This program is distributed in the hope that it will be useful,
Packit 549fdc
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 549fdc
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 549fdc
   GNU General Public License for more details.
Packit 549fdc
Packit 549fdc
   You should have received a copy of the GNU General Public License
Packit 549fdc
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit 549fdc
Packit 549fdc
/* Written by Paul Eggert.  */
Packit 549fdc
Packit 549fdc
#include <config.h>
Packit 549fdc
Packit 549fdc
#include <limits.h>
Packit 549fdc
Packit 549fdc
#include "verify.h"
Packit 549fdc
Packit 549fdc
#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
Packit 549fdc
# pragma GCC diagnostic ignored "-Woverlength-strings"
Packit 549fdc
#endif
Packit 549fdc
Packit 549fdc
/* Macros specified by ISO/IEC TS 18661-1:2014.  */
Packit 549fdc
Packit 549fdc
#define verify_width(width, min, max) \
Packit 549fdc
  verify ((max) >> ((width) - 1 - ((min) < 0)) == 1)
Packit 549fdc
Packit 549fdc
verify_width (CHAR_WIDTH, CHAR_MIN, CHAR_MAX);
Packit 549fdc
verify_width (SCHAR_WIDTH, SCHAR_MIN, SCHAR_MAX);
Packit 549fdc
verify_width (UCHAR_WIDTH, 0, UCHAR_MAX);
Packit 549fdc
verify_width (SHRT_WIDTH, SHRT_MIN, SHRT_MAX);
Packit 549fdc
verify_width (USHRT_WIDTH, 0, USHRT_MAX);
Packit 549fdc
verify_width (INT_WIDTH, INT_MIN, INT_MAX);
Packit 549fdc
verify_width (UINT_WIDTH, 0, UINT_MAX);
Packit 549fdc
verify_width (LONG_WIDTH, LONG_MIN, LONG_MAX);
Packit 549fdc
verify_width (ULONG_WIDTH, 0, ULONG_MAX);
Packit 549fdc
verify_width (LLONG_WIDTH, LLONG_MIN, LLONG_MAX);
Packit 549fdc
verify_width (ULLONG_WIDTH, 0, ULLONG_MAX);
Packit 549fdc
Packit 549fdc
int
Packit 549fdc
main (void)
Packit 549fdc
{
Packit 549fdc
  return 0;
Packit 549fdc
}