85 lines
3.9 KiB
C
85 lines
3.9 KiB
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <limits.h>
|
|
|
|
#define TMin INT_MIN
|
|
#define TMax INT_MAX
|
|
|
|
#include "btest.h"
|
|
#include "bits.h"
|
|
|
|
test_rec test_set[] = {
|
|
/* Copyright (C) 1991-2016 Free Software Foundation, Inc.
|
|
This file is part of the GNU C Library.
|
|
|
|
The GNU C 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 2.1 of the License, or (at your option) any later version.
|
|
|
|
The GNU C 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 Lesser General Public
|
|
License along with the GNU C Library; if not, see
|
|
<http://www.gnu.org/licenses/>. */
|
|
/* This header is separate from features.h so that the compiler can
|
|
include it implicitly at the start of every compilation. It must
|
|
not itself include <features.h> or any other header that includes
|
|
<features.h> because the implicit include comes before any feature
|
|
test macros that may be defined in a source file before it first
|
|
explicitly includes a system header. GCC knows the name of this
|
|
header in order to preinclude it. */
|
|
/* glibc's intent is to support the IEC 559 math functionality, real
|
|
and complex. If the GCC (4.9 and later) predefined macros
|
|
specifying compiler intent are available, use them to determine
|
|
whether the overall intent is to support these features; otherwise,
|
|
presume an older compiler has intent to support these features and
|
|
define these macros by default. */
|
|
/* wchar_t uses Unicode 8.0.0. Version 8.0 of the Unicode Standard is
|
|
synchronized with ISO/IEC 10646:2014, plus Amendment 1 (published
|
|
2015-05-15). */
|
|
/* We do not support C11 <threads.h>. */
|
|
{"bitXor", (funct_t) bitXor, (funct_t) test_bitXor, 2, "& ~", 14, 1,
|
|
{{TMin, TMax},{TMin,TMax},{TMin,TMax}}},
|
|
{"evenBits", (funct_t) evenBits, (funct_t) test_evenBits, 0,
|
|
"! ~ & ^ | + << >>", 8, 1,
|
|
{{TMin, TMax},{TMin,TMax},{TMin,TMax}}},
|
|
{"leastBitPos", (funct_t) leastBitPos, (funct_t) test_leastBitPos, 1, "! ~ & ^ | + << >>", 6, 2,
|
|
{{TMin, TMax},{TMin,TMax},{TMin,TMax}}},
|
|
{"isEqual", (funct_t) isEqual, (funct_t) test_isEqual, 2,
|
|
"! ~ & ^ | + << >>", 5, 2,
|
|
{{TMin, TMax},{TMin,TMax},{TMin,TMax}}},
|
|
{"fitsBits", (funct_t) fitsBits, (funct_t) test_fitsBits, 2,
|
|
"! ~ & ^ | + << >>", 15, 2,
|
|
{{TMin, TMax},{1,32},{TMin,TMax}}},
|
|
{"reverseBytes", (funct_t) reverseBytes, (funct_t) test_reverseBytes, 1,
|
|
"! ~ & ^ | + << >>", 25, 3,
|
|
{{TMin, TMax},{TMin,TMax},{TMin,TMax}}},
|
|
{"isPositive", (funct_t) isPositive, (funct_t) test_isPositive, 1,
|
|
"! ~ & ^ | + << >>", 8, 3,
|
|
{{TMin, TMax},{TMin,TMax},{TMin,TMax}}},
|
|
{"multFiveEighths", (funct_t) multFiveEighths, (funct_t) test_multFiveEighths, 1,
|
|
"! ~ & ^ | + << >>", 12, 3,
|
|
{{-(1<<28)-1, (1<<28)-1},{TMin,TMax},{TMin,TMax}}},
|
|
{"isLessOrEqual", (funct_t) isLessOrEqual, (funct_t) test_isLessOrEqual, 2,
|
|
"! ~ & ^ | + << >>", 24, 3,
|
|
{{TMin, TMax},{TMin,TMax},{TMin,TMax}}},
|
|
{"logicalNeg", (funct_t) logicalNeg, (funct_t) test_logicalNeg, 1,
|
|
"~ & ^ | + << >>", 12, 4,
|
|
{{TMin, TMax},{TMin,TMax},{TMin,TMax}}},
|
|
{"tc2sm", (funct_t) tc2sm, (funct_t) test_tc2sm, 1, "! ~ & ^ | + << >>", 15, 4,
|
|
{{TMin+1, TMax},{TMin+1,TMax},{TMin+1,TMax}}},
|
|
{"leftBitCount", (funct_t) leftBitCount, (funct_t) test_leftBitCount, 1, "! ~ & ^ | + << >>", 40, 4,
|
|
{{TMin, TMax},{TMin,TMax},{TMin,TMax}}},
|
|
{"float_neg", (funct_t) float_neg, (funct_t) test_float_neg, 1,
|
|
"$", 10, 2,
|
|
{{1, 1},{1,1},{1,1}}},
|
|
{"float_half", (funct_t) float_half, (funct_t) test_float_half, 1,
|
|
"$", 30, 4,
|
|
{{1, 1},{1,1},{1,1}}},
|
|
{"", NULL, NULL, 0, "", 0, 0,
|
|
{{0, 0},{0,0},{0,0}}}
|
|
};
|