]> Savannah Git Hosting - gnulib.git/commitdiff
stdbit tests: Adhere better to Gnulib naming conventions.
authorBruno Haible <bruno@clisp.org>
Mon, 13 May 2024 21:46:59 +0000 (23:46 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 13 May 2024 21:50:09 +0000 (23:50 +0200)
* tests/from-glibc/tst-stdc_bit_ceil.c: Renamed from
tests/tst-stdc_bit_ceil.c.
* tests/from-glibc/tst-stdc_bit_floor.c: Renamed from
tests/tst-stdc_bit_floor.c.
* tests/from-glibc/tst-stdc_bit_width.c: Renamed from
tests/tst-stdc_bit_width.c.
* tests/from-glibc/tst-stdc_count_ones.c: Renamed from
tests/tst-stdc_count_ones.c.
* tests/from-glibc/tst-stdc_count_zeros.c: Renamed from
tests/tst-stdc_count_zeros.c.
* tests/from-glibc/tst-stdc_first_leading_one.c: Renamed from
tests/tst-stdc_first_leading_one.c.
* tests/from-glibc/tst-stdc_first_leading_zero.c: Renamed from
tests/tst-stdc_first_leading_zero.c.
* tests/from-glibc/tst-stdc_first_trailing_one.c: Renamed from
tests/tst-stdc_first_trailing_one.c.
* tests/from-glibc/tst-stdc_first_trailing_zero.c: Renamed from
tests/tst-stdc_first_trailing_zero.c.
* tests/from-glibc/tst-stdc_has_single_bit.c: Renamed from
tests/tst-stdc_has_single_bit.c.
* tests/from-glibc/tst-stdc_leading_ones.c: Renamed from
tests/tst-stdc_leading_ones.c.
* tests/from-glibc/tst-stdc_leading_zeros.c: Renamed from
tests/tst-stdc_leading_zeros.c.
* tests/from-glibc/tst-stdc_trailing_ones.c: Renamed from
tests/tst-stdc_trailing_ones.c.
* tests/from-glibc/tst-stdc_trailing_zeros.c: Renamed from
tests/tst-stdc_trailing_zeros.c.
* tests/from-glibc/tst-stdbit.h: Renamed from tests/tst-stdbit.h.
* tests/from-glibc/support/test-driver.c: Renamed from
tests/support/test-driver.c.
* modules/stdbit-tests (Files, Makefile.am): Update.
* config/srclist.txt: Update.

35 files changed:
ChangeLog
config/srclist.txt
modules/stdbit-tests
tests/from-glibc/support/test-driver.c [new file with mode: 0644]
tests/from-glibc/tst-stdbit.h [new file with mode: 0644]
tests/from-glibc/tst-stdc_bit_ceil.c [new file with mode: 0644]
tests/from-glibc/tst-stdc_bit_floor.c [new file with mode: 0644]
tests/from-glibc/tst-stdc_bit_width.c [new file with mode: 0644]
tests/from-glibc/tst-stdc_count_ones.c [new file with mode: 0644]
tests/from-glibc/tst-stdc_count_zeros.c [new file with mode: 0644]
tests/from-glibc/tst-stdc_first_leading_one.c [new file with mode: 0644]
tests/from-glibc/tst-stdc_first_leading_zero.c [new file with mode: 0644]
tests/from-glibc/tst-stdc_first_trailing_one.c [new file with mode: 0644]
tests/from-glibc/tst-stdc_first_trailing_zero.c [new file with mode: 0644]
tests/from-glibc/tst-stdc_has_single_bit.c [new file with mode: 0644]
tests/from-glibc/tst-stdc_leading_ones.c [new file with mode: 0644]
tests/from-glibc/tst-stdc_leading_zeros.c [new file with mode: 0644]
tests/from-glibc/tst-stdc_trailing_ones.c [new file with mode: 0644]
tests/from-glibc/tst-stdc_trailing_zeros.c [new file with mode: 0644]
tests/support/test-driver.c [deleted file]
tests/tst-stdbit.h [deleted file]
tests/tst-stdc_bit_ceil.c [deleted file]
tests/tst-stdc_bit_floor.c [deleted file]
tests/tst-stdc_bit_width.c [deleted file]
tests/tst-stdc_count_ones.c [deleted file]
tests/tst-stdc_count_zeros.c [deleted file]
tests/tst-stdc_first_leading_one.c [deleted file]
tests/tst-stdc_first_leading_zero.c [deleted file]
tests/tst-stdc_first_trailing_one.c [deleted file]
tests/tst-stdc_first_trailing_zero.c [deleted file]
tests/tst-stdc_has_single_bit.c [deleted file]
tests/tst-stdc_leading_ones.c [deleted file]
tests/tst-stdc_leading_zeros.c [deleted file]
tests/tst-stdc_trailing_ones.c [deleted file]
tests/tst-stdc_trailing_zeros.c [deleted file]

index 7d60be26fac76a759712f129eb1906b6f6475673..18aab772fc2630ceb499187a6d1f367a5e287f25 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,40 @@
+2024-05-13  Bruno Haible  <bruno@clisp.org>
+
+       stdbit tests: Adhere better to Gnulib naming conventions.
+       * tests/from-glibc/tst-stdc_bit_ceil.c: Renamed from
+       tests/tst-stdc_bit_ceil.c.
+       * tests/from-glibc/tst-stdc_bit_floor.c: Renamed from
+       tests/tst-stdc_bit_floor.c.
+       * tests/from-glibc/tst-stdc_bit_width.c: Renamed from
+       tests/tst-stdc_bit_width.c.
+       * tests/from-glibc/tst-stdc_count_ones.c: Renamed from
+       tests/tst-stdc_count_ones.c.
+       * tests/from-glibc/tst-stdc_count_zeros.c: Renamed from
+       tests/tst-stdc_count_zeros.c.
+       * tests/from-glibc/tst-stdc_first_leading_one.c: Renamed from
+       tests/tst-stdc_first_leading_one.c.
+       * tests/from-glibc/tst-stdc_first_leading_zero.c: Renamed from
+       tests/tst-stdc_first_leading_zero.c.
+       * tests/from-glibc/tst-stdc_first_trailing_one.c: Renamed from
+       tests/tst-stdc_first_trailing_one.c.
+       * tests/from-glibc/tst-stdc_first_trailing_zero.c: Renamed from
+       tests/tst-stdc_first_trailing_zero.c.
+       * tests/from-glibc/tst-stdc_has_single_bit.c: Renamed from
+       tests/tst-stdc_has_single_bit.c.
+       * tests/from-glibc/tst-stdc_leading_ones.c: Renamed from
+       tests/tst-stdc_leading_ones.c.
+       * tests/from-glibc/tst-stdc_leading_zeros.c: Renamed from
+       tests/tst-stdc_leading_zeros.c.
+       * tests/from-glibc/tst-stdc_trailing_ones.c: Renamed from
+       tests/tst-stdc_trailing_ones.c.
+       * tests/from-glibc/tst-stdc_trailing_zeros.c: Renamed from
+       tests/tst-stdc_trailing_zeros.c.
+       * tests/from-glibc/tst-stdbit.h: Renamed from tests/tst-stdbit.h.
+       * tests/from-glibc/support/test-driver.c: Renamed from
+       tests/support/test-driver.c.
+       * modules/stdbit-tests (Files, Makefile.am): Update.
+       * config/srclist.txt: Update.
+
 2024-05-13  Bruno Haible  <bruno@clisp.org>
 
        config: Clarify which destination files have a different basename.
index 1a254e709d79ee0360e7e9c86efb33ff4d0e9c70..8930847018075e4ee19e6aa31beca8cc5d3f112d 100644 (file)
@@ -71,21 +71,21 @@ $LIBCSRC posix/regex.h                      lib
 #$LIBCSRC posix/regex_internal.h       lib
 #$LIBCSRC posix/regexec.c              lib
 #$LIBCSRC stdlib/canonicalize.c                lib/canonicalize-lgpl.c
-#$LIBCSRC stdlib/tst-stdbit.h                  tests
-$LIBCSRC stdlib/tst-stdc_bit_ceil.c            tests
-$LIBCSRC stdlib/tst-stdc_bit_floor.c           tests
-$LIBCSRC stdlib/tst-stdc_bit_width.c           tests
-$LIBCSRC stdlib/tst-stdc_count_ones.c          tests
-$LIBCSRC stdlib/tst-stdc_count_zeros.c         tests
-$LIBCSRC stdlib/tst-stdc_first_leading_one.c   tests
-$LIBCSRC stdlib/tst-stdc_first_leading_zero.c  tests
-$LIBCSRC stdlib/tst-stdc_first_trailing_one.c  tests
-$LIBCSRC stdlib/tst-stdc_first_trailing_zero.c tests
-$LIBCSRC stdlib/tst-stdc_has_single_bit.c      tests
-$LIBCSRC stdlib/tst-stdc_leading_ones.c                tests
-$LIBCSRC stdlib/tst-stdc_leading_zeros.c       tests
-$LIBCSRC stdlib/tst-stdc_trailing_ones.c       tests
-$LIBCSRC stdlib/tst-stdc_trailing_zeros.c      tests
+#$LIBCSRC stdlib/tst-stdbit.h                  tests/from-glibc
+$LIBCSRC stdlib/tst-stdc_bit_ceil.c            tests/from-glibc
+$LIBCSRC stdlib/tst-stdc_bit_floor.c           tests/from-glibc
+$LIBCSRC stdlib/tst-stdc_bit_width.c           tests/from-glibc
+$LIBCSRC stdlib/tst-stdc_count_ones.c          tests/from-glibc
+$LIBCSRC stdlib/tst-stdc_count_zeros.c         tests/from-glibc
+$LIBCSRC stdlib/tst-stdc_first_leading_one.c   tests/from-glibc
+$LIBCSRC stdlib/tst-stdc_first_leading_zero.c  tests/from-glibc
+$LIBCSRC stdlib/tst-stdc_first_trailing_one.c  tests/from-glibc
+$LIBCSRC stdlib/tst-stdc_first_trailing_zero.c tests/from-glibc
+$LIBCSRC stdlib/tst-stdc_has_single_bit.c      tests/from-glibc
+$LIBCSRC stdlib/tst-stdc_leading_ones.c                tests/from-glibc
+$LIBCSRC stdlib/tst-stdc_leading_zeros.c       tests/from-glibc
+$LIBCSRC stdlib/tst-stdc_trailing_ones.c       tests/from-glibc
+$LIBCSRC stdlib/tst-stdc_trailing_zeros.c      tests/from-glibc
 #$LIBCSRC sysdeps/generic/eloop-threshold.h    lib
 $LIBCSRC time/timegm.c                 lib
 #$LIBCSRC time/mktime.c                        lib
index 3361ff62e020e93af044b2faac82d2125aa1e8fb..15386befbaa382b0efd56f2569dbe3c173c61413 100644 (file)
@@ -1,21 +1,21 @@
 Files:
 tests/macros.h
-tests/support/test-driver.c
-tests/tst-stdbit.h
-tests/tst-stdc_bit_ceil.c
-tests/tst-stdc_bit_floor.c
-tests/tst-stdc_bit_width.c
-tests/tst-stdc_count_ones.c
-tests/tst-stdc_count_zeros.c
-tests/tst-stdc_first_leading_one.c
-tests/tst-stdc_first_leading_zero.c
-tests/tst-stdc_first_trailing_one.c
-tests/tst-stdc_first_trailing_zero.c
-tests/tst-stdc_has_single_bit.c
-tests/tst-stdc_leading_ones.c
-tests/tst-stdc_leading_zeros.c
-tests/tst-stdc_trailing_ones.c
-tests/tst-stdc_trailing_zeros.c
+tests/from-glibc/support/test-driver.c
+tests/from-glibc/tst-stdbit.h
+tests/from-glibc/tst-stdc_bit_ceil.c
+tests/from-glibc/tst-stdc_bit_floor.c
+tests/from-glibc/tst-stdc_bit_width.c
+tests/from-glibc/tst-stdc_count_ones.c
+tests/from-glibc/tst-stdc_count_zeros.c
+tests/from-glibc/tst-stdc_first_leading_one.c
+tests/from-glibc/tst-stdc_first_leading_zero.c
+tests/from-glibc/tst-stdc_first_trailing_one.c
+tests/from-glibc/tst-stdc_first_trailing_zero.c
+tests/from-glibc/tst-stdc_has_single_bit.c
+tests/from-glibc/tst-stdc_leading_ones.c
+tests/from-glibc/tst-stdc_leading_zeros.c
+tests/from-glibc/tst-stdc_trailing_ones.c
+tests/from-glibc/tst-stdc_trailing_zeros.c
 
 Depends-on:
 assert-h
@@ -26,33 +26,61 @@ configure.ac:
 
 Makefile.am:
 TESTS += \
-   tst-stdc_bit_ceil tst-stdc_bit_floor tst-stdc_bit_width \
-   tst-stdc_count_ones tst-stdc_count_zeros tst-stdc_first_leading_one \
-   tst-stdc_first_leading_zero tst-stdc_first_trailing_one \
-   tst-stdc_first_trailing_zero tst-stdc_has_single_bit \
-   tst-stdc_leading_ones tst-stdc_leading_zeros tst-stdc_trailing_ones \
-   tst-stdc_trailing_zeros
+   test-stdc_bit_ceil test-stdc_bit_floor test-stdc_bit_width \
+   test-stdc_count_ones test-stdc_count_zeros test-stdc_first_leading_one \
+   test-stdc_first_leading_zero test-stdc_first_trailing_one \
+   test-stdc_first_trailing_zero test-stdc_has_single_bit \
+   test-stdc_leading_ones test-stdc_leading_zeros test-stdc_trailing_ones \
+   test-stdc_trailing_zeros
 
 check_PROGRAMS += \
-   tst-stdc_bit_ceil tst-stdc_bit_floor tst-stdc_bit_width \
-   tst-stdc_count_ones tst-stdc_count_zeros tst-stdc_first_leading_one \
-   tst-stdc_first_leading_zero tst-stdc_first_trailing_one \
-   tst-stdc_first_trailing_zero tst-stdc_has_single_bit \
-   tst-stdc_leading_ones tst-stdc_leading_zeros tst-stdc_trailing_ones \
-   tst-stdc_trailing_zeros
-
-TEST_STDBIT_CPPFLAGS = $(AM_CPPFLAGS) -DGNULIB_TEST_STDBIT
-tst_stdc_bit_ceil_CPPFLAGS            = $(TEST_STDBIT_CPPFLAGS)
-tst_stdc_bit_floor_CPPFLAGS           = $(TEST_STDBIT_CPPFLAGS)
-tst_stdc_bit_width_CPPFLAGS           = $(TEST_STDBIT_CPPFLAGS)
-tst_stdc_count_ones_CPPFLAGS          = $(TEST_STDBIT_CPPFLAGS)
-tst_stdc_count_zeros_CPPFLAGS         = $(TEST_STDBIT_CPPFLAGS)
-tst_stdc_first_leading_one_CPPFLAGS   = $(TEST_STDBIT_CPPFLAGS)
-tst_stdc_first_leading_zero_CPPFLAGS  = $(TEST_STDBIT_CPPFLAGS)
-tst_stdc_first_trailing_one_CPPFLAGS  = $(TEST_STDBIT_CPPFLAGS)
-tst_stdc_first_trailing_zero_CPPFLAGS = $(TEST_STDBIT_CPPFLAGS)
-tst_stdc_has_single_bit_CPPFLAGS      = $(TEST_STDBIT_CPPFLAGS)
-tst_stdc_leading_ones_CPPFLAGS        = $(TEST_STDBIT_CPPFLAGS)
-tst_stdc_leading_zeros_CPPFLAGS       = $(TEST_STDBIT_CPPFLAGS)
-tst_stdc_trailing_ones_CPPFLAGS       = $(TEST_STDBIT_CPPFLAGS)
-tst_stdc_trailing_zeros_CPPFLAGS      = $(TEST_STDBIT_CPPFLAGS)
+   test-stdc_bit_ceil test-stdc_bit_floor test-stdc_bit_width \
+   test-stdc_count_ones test-stdc_count_zeros test-stdc_first_leading_one \
+   test-stdc_first_leading_zero test-stdc_first_trailing_one \
+   test-stdc_first_trailing_zero test-stdc_has_single_bit \
+   test-stdc_leading_ones test-stdc_leading_zeros test-stdc_trailing_ones \
+   test-stdc_trailing_zeros
+
+TEST_STDBIT_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/from-glibc -DGNULIB_TEST_STDBIT
+
+test_stdc_bit_ceil_SOURCES             = from-glibc/tst-stdc_bit_ceil.c
+test_stdc_bit_ceil_CPPFLAGS            = $(TEST_STDBIT_CPPFLAGS)
+
+test_stdc_bit_floor_SOURCES            = from-glibc/tst-stdc_bit_floor.c
+test_stdc_bit_floor_CPPFLAGS           = $(TEST_STDBIT_CPPFLAGS)
+
+test_stdc_bit_width_SOURCES            = from-glibc/tst-stdc_bit_width.c
+test_stdc_bit_width_CPPFLAGS           = $(TEST_STDBIT_CPPFLAGS)
+
+test_stdc_count_ones_SOURCES           = from-glibc/tst-stdc_count_ones.c
+test_stdc_count_ones_CPPFLAGS          = $(TEST_STDBIT_CPPFLAGS)
+
+test_stdc_count_zeros_SOURCES          = from-glibc/tst-stdc_count_zeros.c
+test_stdc_count_zeros_CPPFLAGS         = $(TEST_STDBIT_CPPFLAGS)
+
+test_stdc_first_leading_one_SOURCES    = from-glibc/tst-stdc_first_leading_one.c
+test_stdc_first_leading_one_CPPFLAGS   = $(TEST_STDBIT_CPPFLAGS)
+
+test_stdc_first_leading_zero_SOURCES   = from-glibc/tst-stdc_first_leading_zero.c
+test_stdc_first_leading_zero_CPPFLAGS  = $(TEST_STDBIT_CPPFLAGS)
+
+test_stdc_first_trailing_one_SOURCES   = from-glibc/tst-stdc_first_trailing_one.c
+test_stdc_first_trailing_one_CPPFLAGS  = $(TEST_STDBIT_CPPFLAGS)
+
+test_stdc_first_trailing_zero_SOURCES  = from-glibc/tst-stdc_first_trailing_zero.c
+test_stdc_first_trailing_zero_CPPFLAGS = $(TEST_STDBIT_CPPFLAGS)
+
+test_stdc_has_single_bit_SOURCES       = from-glibc/tst-stdc_has_single_bit.c
+test_stdc_has_single_bit_CPPFLAGS      = $(TEST_STDBIT_CPPFLAGS)
+
+test_stdc_leading_ones_SOURCES         = from-glibc/tst-stdc_leading_ones.c
+test_stdc_leading_ones_CPPFLAGS        = $(TEST_STDBIT_CPPFLAGS)
+
+test_stdc_leading_zeros_SOURCES        = from-glibc/tst-stdc_leading_zeros.c
+test_stdc_leading_zeros_CPPFLAGS       = $(TEST_STDBIT_CPPFLAGS)
+
+test_stdc_trailing_ones_SOURCES        = from-glibc/tst-stdc_trailing_ones.c
+test_stdc_trailing_ones_CPPFLAGS       = $(TEST_STDBIT_CPPFLAGS)
+
+test_stdc_trailing_zeros_SOURCES       = from-glibc/tst-stdc_trailing_zeros.c
+test_stdc_trailing_zeros_CPPFLAGS      = $(TEST_STDBIT_CPPFLAGS)
diff --git a/tests/from-glibc/support/test-driver.c b/tests/from-glibc/support/test-driver.c
new file mode 100644 (file)
index 0000000..84ac82e
--- /dev/null
@@ -0,0 +1,5 @@
+int
+main (void)
+{
+  return do_test ();
+}
diff --git a/tests/from-glibc/tst-stdbit.h b/tests/from-glibc/tst-stdbit.h
new file mode 100644 (file)
index 0000000..0a0ab6b
--- /dev/null
@@ -0,0 +1,225 @@
+/* Common test support for <stdbit.h> tests.
+   Copyright (C) 2024 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
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _TST_STDBIT_H
+#define _TST_STDBIT_H
+
+#if GNULIB_TEST_STDBIT
+# include <libc-config.h>
+#endif
+
+#include <stdbit.h>
+#include <stdbool.h>
+
+#if !GNULIB_TEST_STDBIT
+# include <array_length.h>
+# include <support/check.h>
+#else
+# include <stdint.h>
+# include <macros.h>
+# define array_length(a) (sizeof (a) / sizeof *(a))
+# define TEST_COMPARE(a, b) ASSERT ((a) == (b))
+#endif
+
+struct stdbit_test
+{
+  /* The test input.  */
+  uint64_t x;
+  /* Expected results if that test input is converted to 8, 16, 32 or
+     64 bits and then passed to the function under test for that
+     width.  */
+  uint64_t res_8, res_16, res_32, res_64;
+};
+
+#if !GNULIB_TEST_STDBIT
+# define TEST_TYPE(EXPR, TYPE)                                         \
+  _Static_assert (_Generic ((EXPR), TYPE: 1, default: 0), "bad type")
+#elif ((defined __GNUC__ && 2 <= __GNUC__) \
+       || (defined __clang_major__ && 4 <= __clang_major__) \
+       || (defined __IBMC__ && 1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
+       || (defined __SUNPRO_C && 0x5110 <= __SUNPRO_C && !__STDC__) \
+       || 202311 <= __STDC_VERSION__)
+# if __HAVE_GENERIC_SELECTION
+#  define TEST_TYPE(EXPR, TYPE) \
+    static_assert (_Generic (EXPR, TYPE: 1, default: 0))
+# else
+#  define TEST_TYPE(EXPR, TYPE) static_assert (sizeof (EXPR) == sizeof (TYPE))
+# endif
+#else
+/* A pre-C11 platform that lacks typeof.  */
+# define TEST_TYPE(EXPR, TYPE) static_assert (sizeof (TYPE) <= sizeof (EXPR))
+#endif
+
+/* Test a <stdbit.h> function / macro.  For each function family, and
+   each input type, we test both with and without macros from the
+   header being used, both with a possibly wider argument being passed
+   (that must be truncated by the prototype) and with the argument
+   truncated in the caller, as well as testing the type-generic macro
+   (with the argument truncated in the caller).  Also test that the
+   results have the correct type; also test truncation from
+   floating-point arguments (valid for functions, including with macro
+   expansion, because the prototype must implicitly convert to integer
+   type; not valid for the type-generic macros).  Also test that the
+   argument is evaluated exactly once.  Also test the macros are
+   usable (e.g. in typeof) at top level (GCC doesn't allow ({})
+   outside functions: bug 93239).  */
+
+#define TEST_STDBIT_T(FUNC, X, RES, TTYPE, TYPE, SUFFIX)               \
+  do                                                                   \
+    {                                                                  \
+      TEST_COMPARE (FUNC ## SUFFIX (X), (RES));                                \
+      TEST_TYPE (FUNC ## SUFFIX (X), TTYPE);                           \
+      TEST_COMPARE ((FUNC ## SUFFIX) (X), (RES));                      \
+      TEST_TYPE ((FUNC ## SUFFIX) (X), TTYPE);                         \
+      TEST_COMPARE (FUNC ## SUFFIX ((TYPE) (X)), (RES));               \
+      TEST_TYPE (FUNC ## SUFFIX ((TYPE) (X)), TTYPE);                  \
+      TEST_COMPARE ((FUNC ## SUFFIX) ((TYPE) (X)), (RES));             \
+      TEST_TYPE ((FUNC ## SUFFIX) ((TYPE) (X)), TTYPE);                        \
+      TEST_COMPARE (FUNC ((TYPE) (X)), (RES));                         \
+      TEST_TYPE (FUNC ((TYPE) (X)), TTYPE);                            \
+      if (sizeof (TYPE) <= 2)                                          \
+       {                                                               \
+         TEST_COMPARE (FUNC ## SUFFIX ((float) (TYPE) (X)), (RES));    \
+         TEST_TYPE (FUNC ## SUFFIX ((float) (TYPE) (X)), TTYPE);       \
+         TEST_COMPARE ((FUNC ## SUFFIX) ((float) (TYPE) (X)), (RES));  \
+         TEST_TYPE ((FUNC ## SUFFIX) ((float) (TYPE) (X)), TTYPE);     \
+       }                                                               \
+      if (sizeof (TYPE) <= 4)                                          \
+       {                                                               \
+         TEST_COMPARE (FUNC ## SUFFIX ((double) (TYPE) (X)), (RES));   \
+         TEST_TYPE (FUNC ## SUFFIX ((double) (TYPE) (X)), TTYPE);      \
+         TEST_COMPARE ((FUNC ## SUFFIX) ((double) (TYPE) (X)), (RES)); \
+         TEST_TYPE ((FUNC ## SUFFIX) ((double) (TYPE) (X)), TTYPE);    \
+         TEST_COMPARE (FUNC ## SUFFIX ((long double) (TYPE) (X)), (RES)); \
+         TEST_TYPE (FUNC ## SUFFIX ((long double) (TYPE) (X)), TTYPE); \
+         TEST_COMPARE ((FUNC ## SUFFIX) ((long double) (TYPE) (X)), (RES)); \
+         TEST_TYPE ((FUNC ## SUFFIX) ((long double) (TYPE) (X)), TTYPE); \
+       }                                                               \
+      TYPE xt = (X);                                                   \
+      TEST_COMPARE (FUNC ## SUFFIX (xt++), (RES));                     \
+      TEST_COMPARE (xt, (TYPE) ((X) + 1));                             \
+      xt = (X);                                                                \
+      TEST_COMPARE (FUNC (xt++), (RES));                               \
+      TEST_COMPARE (xt, (TYPE) ((X) + 1));                             \
+    }                                                                  \
+  while (0)
+
+#define TEST_STDBIT_UI(FUNC, INPUTS)                   \
+  do                                                   \
+    for (int i = 0; i < array_length (INPUTS); i++)    \
+      {                                                        \
+       uint64_t x = (INPUTS)[i].x;                     \
+       unsigned int res_8 = (INPUTS)[i].res_8;         \
+       unsigned int res_16 = (INPUTS)[i].res_16;       \
+       unsigned int res_32 = (INPUTS)[i].res_32;       \
+       unsigned int res_64 = (INPUTS)[i].res_64;       \
+       unsigned int res_l = (sizeof (long int) == 4    \
+                             ? res_32 : res_64);       \
+       TEST_STDBIT_T (FUNC, x, res_8, unsigned int,    \
+                      unsigned char, _uc);             \
+       TEST_STDBIT_T (FUNC, x, res_16, unsigned int,   \
+                      unsigned short, _us);            \
+       TEST_STDBIT_T (FUNC, x, res_32, unsigned int,   \
+                      unsigned int, _ui);              \
+       TEST_STDBIT_T (FUNC, x, res_l, unsigned int,    \
+                      unsigned long int, _ul);         \
+       TEST_STDBIT_T (FUNC, x, res_64, unsigned int,   \
+                      unsigned long long int, _ull);   \
+      }                                                        \
+  while (0)
+
+#define TEST_STDBIT_BOOL(FUNC, INPUTS)                                 \
+  do                                                                   \
+    for (int i = 0; i < array_length (INPUTS); i++)                    \
+      {                                                                        \
+       uint64_t x = (INPUTS)[i].x;                                     \
+       bool res_8 = (INPUTS)[i].res_8;                                 \
+       bool res_16 = (INPUTS)[i].res_16;                               \
+       bool res_32 = (INPUTS)[i].res_32;                               \
+       bool res_64 = (INPUTS)[i].res_64;                               \
+       bool res_l = (sizeof (long int) == 4 ? res_32 : res_64);        \
+       TEST_STDBIT_T (FUNC, x, res_8, _Bool, unsigned char, _uc);      \
+       TEST_STDBIT_T (FUNC, x, res_16, _Bool, unsigned short, _us);    \
+       TEST_STDBIT_T (FUNC, x, res_32, _Bool, unsigned int, _ui);      \
+       TEST_STDBIT_T (FUNC, x, res_l, _Bool, unsigned long int, _ul);  \
+       TEST_STDBIT_T (FUNC, x, res_64, _Bool,                          \
+                      unsigned long long int, _ull);                   \
+      }                                                                        \
+  while (0)
+
+#define TEST_STDBIT_SAME(FUNC, INPUTS)                         \
+  do                                                           \
+    for (int i = 0; i < array_length (INPUTS); i++)            \
+      {                                                                \
+       uint64_t x = (INPUTS)[i].x;                             \
+       unsigned char res_8 = (INPUTS)[i].res_8;                \
+       unsigned short res_16 = (INPUTS)[i].res_16;             \
+       unsigned int res_32 = (INPUTS)[i].res_32;               \
+       unsigned long long int res_64 = (INPUTS)[i].res_64;     \
+       unsigned long int res_l = (sizeof (long int) == 4       \
+                                  ? res_32 : res_64);          \
+       TEST_STDBIT_T (FUNC, x, res_8, unsigned char,           \
+                      unsigned char, _uc);                     \
+       TEST_STDBIT_T (FUNC, x, res_16, unsigned short,         \
+                      unsigned short, _us);                    \
+       TEST_STDBIT_T (FUNC, x, res_32, unsigned int,           \
+                      unsigned int, _ui);                      \
+       TEST_STDBIT_T (FUNC, x, res_l, unsigned long int,       \
+                      unsigned long int, _ul);                 \
+       TEST_STDBIT_T (FUNC, x, res_64, unsigned long long int, \
+                      unsigned long long int, _ull);           \
+      }                                                                \
+  while (0)
+
+#define TEST_STDBIT_UI_TOPLEVEL(FUNC)                          \
+  TEST_TYPE (FUNC ## _uc ((unsigned char) 0), unsigned int);   \
+  TEST_TYPE (FUNC ((unsigned char) 0), unsigned int);          \
+  TEST_TYPE (FUNC ## _us ((unsigned short) 0), unsigned int);  \
+  TEST_TYPE (FUNC ((unsigned short) 0), unsigned int);         \
+  TEST_TYPE (FUNC ## _ui (0U), unsigned int);                  \
+  TEST_TYPE (FUNC (0U), unsigned int);                         \
+  TEST_TYPE (FUNC ## _ul (0UL), unsigned int);                 \
+  TEST_TYPE (FUNC (0UL), unsigned int);                                \
+  TEST_TYPE (FUNC ## _ull (0ULL), unsigned int);               \
+  TEST_TYPE (FUNC (0ULL), unsigned int)
+
+#define TEST_STDBIT_BOOL_TOPLEVEL(FUNC)                        \
+  TEST_TYPE (FUNC ## _uc ((unsigned char) 0), _Bool);  \
+  TEST_TYPE (FUNC ((unsigned char) 0), _Bool);         \
+  TEST_TYPE (FUNC ## _us ((unsigned short) 0), _Bool); \
+  TEST_TYPE (FUNC ((unsigned short) 0), _Bool);                \
+  TEST_TYPE (FUNC ## _ui (0U), _Bool);                 \
+  TEST_TYPE (FUNC (0U), _Bool);                                \
+  TEST_TYPE (FUNC ## _ul (0UL), _Bool);                        \
+  TEST_TYPE (FUNC (0UL), _Bool);                       \
+  TEST_TYPE (FUNC ## _ull (0ULL), _Bool);              \
+  TEST_TYPE (FUNC (0ULL), _Bool)
+
+#define TEST_STDBIT_SAME_TOPLEVEL(FUNC)                                \
+  TEST_TYPE (FUNC ## _uc ((unsigned char) 0), unsigned char);  \
+  TEST_TYPE (FUNC ((unsigned char) 0), unsigned char);         \
+  TEST_TYPE (FUNC ## _us ((unsigned short) 0), unsigned short);        \
+  TEST_TYPE (FUNC ((unsigned short) 0), unsigned short);       \
+  TEST_TYPE (FUNC ## _ui (0U), unsigned int);                  \
+  TEST_TYPE (FUNC (0U), unsigned int);                         \
+  TEST_TYPE (FUNC ## _ul (0UL), unsigned long int);            \
+  TEST_TYPE (FUNC (0UL), unsigned long int);                   \
+  TEST_TYPE (FUNC ## _ull (0ULL), unsigned long long int);     \
+  TEST_TYPE (FUNC (0ULL), unsigned long long int)
+
+#endif
diff --git a/tests/from-glibc/tst-stdc_bit_ceil.c b/tests/from-glibc/tst-stdc_bit_ceil.c
new file mode 100644 (file)
index 0000000..9f2f327
--- /dev/null
@@ -0,0 +1,88 @@
+/* Test stdc_bit_ceil functions and macros.
+   Copyright (C) 2024 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <tst-stdbit.h>
+
+static const struct stdbit_test inputs[] =
+  {
+    { 0ULL, 0x1, 0x1, 0x1, 0x1ULL },
+    { 0x1ULL, 0x1, 0x1, 0x1, 0x1ULL },
+    { 0x2ULL, 0x2, 0x2, 0x2, 0x2ULL },
+    { 0x3ULL, 0x4, 0x4, 0x4, 0x4ULL },
+    { 0x4ULL, 0x4, 0x4, 0x4, 0x4ULL },
+    { 0x5ULL, 0x8, 0x8, 0x8, 0x8ULL },
+    { 0x6ULL, 0x8, 0x8, 0x8, 0x8ULL },
+    { 0x7ULL, 0x8, 0x8, 0x8, 0x8ULL },
+    { 0x8ULL, 0x8, 0x8, 0x8, 0x8ULL },
+    { 0x9ULL, 0x10, 0x10, 0x10, 0x10ULL },
+    { 0xaULL, 0x10, 0x10, 0x10, 0x10ULL },
+    { 0xbULL, 0x10, 0x10, 0x10, 0x10ULL },
+    { 0xcULL, 0x10, 0x10, 0x10, 0x10ULL },
+    { 0xdULL, 0x10, 0x10, 0x10, 0x10ULL },
+    { 0xeULL, 0x10, 0x10, 0x10, 0x10ULL },
+    { 0xfULL, 0x10, 0x10, 0x10, 0x10ULL },
+    { 0x10ULL, 0x10, 0x10, 0x10, 0x10ULL },
+    { 0x11ULL, 0x20, 0x20, 0x20, 0x20ULL },
+    { 0x12ULL, 0x20, 0x20, 0x20, 0x20ULL },
+    { 0x1fULL, 0x20, 0x20, 0x20, 0x20ULL },
+    { 0x20ULL, 0x20, 0x20, 0x20, 0x20ULL },
+    { 0x7fULL, 0x80, 0x80, 0x80, 0x80ULL },
+    { 0x80ULL, 0x80, 0x80, 0x80, 0x80ULL },
+    { 0x81ULL, 0, 0x100, 0x100, 0x100ULL },
+    { 0x9aULL, 0, 0x100, 0x100, 0x100ULL },
+    { 0xf3ULL, 0, 0x100, 0x100, 0x100ULL },
+    { 0xffULL, 0, 0x100, 0x100, 0x100ULL },
+    { 0x100ULL, 0x1, 0x100, 0x100, 0x100ULL },
+    { 0x101ULL, 0x1, 0x200, 0x200, 0x200ULL },
+    { 0x102ULL, 0x2, 0x200, 0x200, 0x200ULL },
+    { 0x1feULL, 0, 0x200, 0x200, 0x200ULL },
+    { 0x1ffULL, 0, 0x200, 0x200, 0x200ULL },
+    { 0x200ULL, 0x1, 0x200, 0x200, 0x200ULL },
+    { 0x234ULL, 0x40, 0x400, 0x400, 0x400ULL },
+    { 0x4567ULL, 0x80, 0x8000, 0x8000, 0x8000ULL },
+    { 0x7fffULL, 0, 0x8000, 0x8000, 0x8000ULL },
+    { 0x8000ULL, 0x1, 0x8000, 0x8000, 0x8000ULL },
+    { 0x8001ULL, 0x1, 0, 0x10000, 0x10000ULL },
+    { 0xfffeULL, 0, 0, 0x10000, 0x10000ULL },
+    { 0xffffULL, 0, 0, 0x10000, 0x10000ULL },
+    { 0x10000ULL, 0x1, 0x1, 0x10000, 0x10000ULL },
+    { 0x10001ULL, 0x1, 0x1, 0x20000, 0x20000ULL },
+    { 0xfedcba98ULL, 0, 0, 0, 0x100000000ULL },
+    { 0xfffffefeULL, 0, 0, 0, 0x100000000ULL },
+    { 0xffffffffULL, 0, 0, 0, 0x100000000ULL },
+    { 0x100000000ULL, 0x1, 0x1, 0x1, 0x100000000ULL },
+    { 0x100000001ULL, 0x1, 0x1, 0x1, 0x200000000ULL },
+    { 0x123456789ULL, 0, 0x8000, 0x40000000, 0x200000000ULL },
+    { 0x123456789abcdefULL, 0, 0, 0, 0x200000000000000ULL },
+    { 0x789abcdef0123456ULL, 0x80, 0x4000, 0, 0x8000000000000000ULL },
+    { 0x8000000000000000ULL, 0x1, 0x1, 0x1, 0x8000000000000000ULL },
+    { 0x8000000000000001ULL, 0x1, 0x1, 0x1, 0ULL },
+    { 0xfffffffffffffffeULL, 0, 0, 0, 0ULL },
+    { 0xffffffffffffffffULL, 0, 0, 0, 0ULL },
+  };
+
+TEST_STDBIT_SAME_TOPLEVEL (stdc_bit_ceil);
+
+static int
+do_test (void)
+{
+  TEST_STDBIT_SAME (stdc_bit_ceil, inputs);
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/tests/from-glibc/tst-stdc_bit_floor.c b/tests/from-glibc/tst-stdc_bit_floor.c
new file mode 100644 (file)
index 0000000..3f1d053
--- /dev/null
@@ -0,0 +1,88 @@
+/* Test stdc_bit_floor functions and macros.
+   Copyright (C) 2024 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <tst-stdbit.h>
+
+static const struct stdbit_test inputs[] =
+  {
+    { 0ULL, 0, 0, 0, 0ULL },
+    { 0x1ULL, 0x1, 0x1, 0x1, 0x1ULL },
+    { 0x2ULL, 0x2, 0x2, 0x2, 0x2ULL },
+    { 0x3ULL, 0x2, 0x2, 0x2, 0x2ULL },
+    { 0x4ULL, 0x4, 0x4, 0x4, 0x4ULL },
+    { 0x5ULL, 0x4, 0x4, 0x4, 0x4ULL },
+    { 0x6ULL, 0x4, 0x4, 0x4, 0x4ULL },
+    { 0x7ULL, 0x4, 0x4, 0x4, 0x4ULL },
+    { 0x8ULL, 0x8, 0x8, 0x8, 0x8ULL },
+    { 0x9ULL, 0x8, 0x8, 0x8, 0x8ULL },
+    { 0xaULL, 0x8, 0x8, 0x8, 0x8ULL },
+    { 0xbULL, 0x8, 0x8, 0x8, 0x8ULL },
+    { 0xcULL, 0x8, 0x8, 0x8, 0x8ULL },
+    { 0xdULL, 0x8, 0x8, 0x8, 0x8ULL },
+    { 0xeULL, 0x8, 0x8, 0x8, 0x8ULL },
+    { 0xfULL, 0x8, 0x8, 0x8, 0x8ULL },
+    { 0x10ULL, 0x10, 0x10, 0x10, 0x10ULL },
+    { 0x11ULL, 0x10, 0x10, 0x10, 0x10ULL },
+    { 0x12ULL, 0x10, 0x10, 0x10, 0x10ULL },
+    { 0x1fULL, 0x10, 0x10, 0x10, 0x10ULL },
+    { 0x20ULL, 0x20, 0x20, 0x20, 0x20ULL },
+    { 0x7fULL, 0x40, 0x40, 0x40, 0x40ULL },
+    { 0x80ULL, 0x80, 0x80, 0x80, 0x80ULL },
+    { 0x81ULL, 0x80, 0x80, 0x80, 0x80ULL },
+    { 0x9aULL, 0x80, 0x80, 0x80, 0x80ULL },
+    { 0xf3ULL, 0x80, 0x80, 0x80, 0x80ULL },
+    { 0xffULL, 0x80, 0x80, 0x80, 0x80ULL },
+    { 0x100ULL, 0, 0x100, 0x100, 0x100ULL },
+    { 0x101ULL, 0x1, 0x100, 0x100, 0x100ULL },
+    { 0x102ULL, 0x2, 0x100, 0x100, 0x100ULL },
+    { 0x1feULL, 0x80, 0x100, 0x100, 0x100ULL },
+    { 0x1ffULL, 0x80, 0x100, 0x100, 0x100ULL },
+    { 0x200ULL, 0, 0x200, 0x200, 0x200ULL },
+    { 0x234ULL, 0x20, 0x200, 0x200, 0x200ULL },
+    { 0x4567ULL, 0x40, 0x4000, 0x4000, 0x4000ULL },
+    { 0x7fffULL, 0x80, 0x4000, 0x4000, 0x4000ULL },
+    { 0x8000ULL, 0, 0x8000, 0x8000, 0x8000ULL },
+    { 0x8001ULL, 0x1, 0x8000, 0x8000, 0x8000ULL },
+    { 0xfffeULL, 0x80, 0x8000, 0x8000, 0x8000ULL },
+    { 0xffffULL, 0x80, 0x8000, 0x8000, 0x8000ULL },
+    { 0x10000ULL, 0, 0, 0x10000, 0x10000ULL },
+    { 0x10001ULL, 0x1, 0x1, 0x10000, 0x10000ULL },
+    { 0xfedcba98ULL, 0x80, 0x8000, 0x80000000, 0x80000000ULL },
+    { 0xfffffefeULL, 0x80, 0x8000, 0x80000000, 0x80000000ULL },
+    { 0xffffffffULL, 0x80, 0x8000, 0x80000000, 0x80000000ULL },
+    { 0x100000000ULL, 0, 0, 0, 0x100000000ULL },
+    { 0x100000001ULL, 0x1, 0x1, 0x1, 0x100000000ULL },
+    { 0x123456789ULL, 0x80, 0x4000, 0x20000000, 0x100000000ULL },
+    { 0x123456789abcdefULL, 0x80, 0x8000, 0x80000000, 0x100000000000000ULL },
+    { 0x789abcdef0123456ULL, 0x40, 0x2000, 0x80000000, 0x4000000000000000ULL },
+    { 0x8000000000000000ULL, 0, 0, 0, 0x8000000000000000ULL },
+    { 0x8000000000000001ULL, 0x1, 0x1, 0x1, 0x8000000000000000ULL },
+    { 0xfffffffffffffffeULL, 0x80, 0x8000, 0x80000000, 0x8000000000000000ULL },
+    { 0xffffffffffffffffULL, 0x80, 0x8000, 0x80000000, 0x8000000000000000ULL },
+  };
+
+TEST_STDBIT_SAME_TOPLEVEL (stdc_bit_floor);
+
+static int
+do_test (void)
+{
+  TEST_STDBIT_SAME (stdc_bit_floor, inputs);
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/tests/from-glibc/tst-stdc_bit_width.c b/tests/from-glibc/tst-stdc_bit_width.c
new file mode 100644 (file)
index 0000000..b3bb6f6
--- /dev/null
@@ -0,0 +1,88 @@
+/* Test stdc_bit_width functions and macros.
+   Copyright (C) 2024 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <tst-stdbit.h>
+
+static const struct stdbit_test inputs[] =
+  {
+    { 0ULL, 0, 0, 0, 0 },
+    { 0x1ULL, 1, 1, 1, 1 },
+    { 0x2ULL, 2, 2, 2, 2 },
+    { 0x3ULL, 2, 2, 2, 2 },
+    { 0x4ULL, 3, 3, 3, 3 },
+    { 0x5ULL, 3, 3, 3, 3 },
+    { 0x6ULL, 3, 3, 3, 3 },
+    { 0x7ULL, 3, 3, 3, 3 },
+    { 0x8ULL, 4, 4, 4, 4 },
+    { 0x9ULL, 4, 4, 4, 4 },
+    { 0xaULL, 4, 4, 4, 4 },
+    { 0xbULL, 4, 4, 4, 4 },
+    { 0xcULL, 4, 4, 4, 4 },
+    { 0xdULL, 4, 4, 4, 4 },
+    { 0xeULL, 4, 4, 4, 4 },
+    { 0xfULL, 4, 4, 4, 4 },
+    { 0x10ULL, 5, 5, 5, 5 },
+    { 0x11ULL, 5, 5, 5, 5 },
+    { 0x12ULL, 5, 5, 5, 5 },
+    { 0x1fULL, 5, 5, 5, 5 },
+    { 0x20ULL, 6, 6, 6, 6 },
+    { 0x7fULL, 7, 7, 7, 7 },
+    { 0x80ULL, 8, 8, 8, 8 },
+    { 0x81ULL, 8, 8, 8, 8 },
+    { 0x9aULL, 8, 8, 8, 8 },
+    { 0xf3ULL, 8, 8, 8, 8 },
+    { 0xffULL, 8, 8, 8, 8 },
+    { 0x100ULL, 0, 9, 9, 9 },
+    { 0x101ULL, 1, 9, 9, 9 },
+    { 0x102ULL, 2, 9, 9, 9 },
+    { 0x1feULL, 8, 9, 9, 9 },
+    { 0x1ffULL, 8, 9, 9, 9 },
+    { 0x200ULL, 0, 10, 10, 10 },
+    { 0x234ULL, 6, 10, 10, 10 },
+    { 0x4567ULL, 7, 15, 15, 15 },
+    { 0x7fffULL, 8, 15, 15, 15 },
+    { 0x8000ULL, 0, 16, 16, 16 },
+    { 0x8001ULL, 1, 16, 16, 16 },
+    { 0xfffeULL, 8, 16, 16, 16 },
+    { 0xffffULL, 8, 16, 16, 16 },
+    { 0x10000ULL, 0, 0, 17, 17 },
+    { 0x10001ULL, 1, 1, 17, 17 },
+    { 0xfedcba98ULL, 8, 16, 32, 32 },
+    { 0xfffffefeULL, 8, 16, 32, 32 },
+    { 0xffffffffULL, 8, 16, 32, 32 },
+    { 0x100000000ULL, 0, 0, 0, 33 },
+    { 0x100000001ULL, 1, 1, 1, 33 },
+    { 0x123456789ULL, 8, 15, 30, 33 },
+    { 0x123456789abcdefULL, 8, 16, 32, 57 },
+    { 0x789abcdef0123456ULL, 7, 14, 32, 63 },
+    { 0x8000000000000000ULL, 0, 0, 0, 64 },
+    { 0x8000000000000001ULL, 1, 1, 1, 64 },
+    { 0xfffffffffffffffeULL, 8, 16, 32, 64 },
+    { 0xffffffffffffffffULL, 8, 16, 32, 64 },
+  };
+
+TEST_STDBIT_UI_TOPLEVEL (stdc_bit_width);
+
+static int
+do_test (void)
+{
+  TEST_STDBIT_UI (stdc_bit_width, inputs);
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/tests/from-glibc/tst-stdc_count_ones.c b/tests/from-glibc/tst-stdc_count_ones.c
new file mode 100644 (file)
index 0000000..8f8e3a7
--- /dev/null
@@ -0,0 +1,88 @@
+/* Test stdc_count_ones functions and macros.
+   Copyright (C) 2024 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <tst-stdbit.h>
+
+static const struct stdbit_test inputs[] =
+  {
+    { 0ULL, 0, 0, 0, 0 },
+    { 0x1ULL, 1, 1, 1, 1 },
+    { 0x2ULL, 1, 1, 1, 1 },
+    { 0x3ULL, 2, 2, 2, 2 },
+    { 0x4ULL, 1, 1, 1, 1 },
+    { 0x5ULL, 2, 2, 2, 2 },
+    { 0x6ULL, 2, 2, 2, 2 },
+    { 0x7ULL, 3, 3, 3, 3 },
+    { 0x8ULL, 1, 1, 1, 1 },
+    { 0x9ULL, 2, 2, 2, 2 },
+    { 0xaULL, 2, 2, 2, 2 },
+    { 0xbULL, 3, 3, 3, 3 },
+    { 0xcULL, 2, 2, 2, 2 },
+    { 0xdULL, 3, 3, 3, 3 },
+    { 0xeULL, 3, 3, 3, 3 },
+    { 0xfULL, 4, 4, 4, 4 },
+    { 0x10ULL, 1, 1, 1, 1 },
+    { 0x11ULL, 2, 2, 2, 2 },
+    { 0x12ULL, 2, 2, 2, 2 },
+    { 0x1fULL, 5, 5, 5, 5 },
+    { 0x20ULL, 1, 1, 1, 1 },
+    { 0x7fULL, 7, 7, 7, 7 },
+    { 0x80ULL, 1, 1, 1, 1 },
+    { 0x81ULL, 2, 2, 2, 2 },
+    { 0x9aULL, 4, 4, 4, 4 },
+    { 0xf3ULL, 6, 6, 6, 6 },
+    { 0xffULL, 8, 8, 8, 8 },
+    { 0x100ULL, 0, 1, 1, 1 },
+    { 0x101ULL, 1, 2, 2, 2 },
+    { 0x102ULL, 1, 2, 2, 2 },
+    { 0x1feULL, 7, 8, 8, 8 },
+    { 0x1ffULL, 8, 9, 9, 9 },
+    { 0x200ULL, 0, 1, 1, 1 },
+    { 0x234ULL, 3, 4, 4, 4 },
+    { 0x4567ULL, 5, 8, 8, 8 },
+    { 0x7fffULL, 8, 15, 15, 15 },
+    { 0x8000ULL, 0, 1, 1, 1 },
+    { 0x8001ULL, 1, 2, 2, 2 },
+    { 0xfffeULL, 7, 15, 15, 15 },
+    { 0xffffULL, 8, 16, 16, 16 },
+    { 0x10000ULL, 0, 0, 1, 1 },
+    { 0x10001ULL, 1, 1, 2, 2 },
+    { 0xfedcba98ULL, 3, 8, 20, 20 },
+    { 0xfffffefeULL, 7, 14, 30, 30 },
+    { 0xffffffffULL, 8, 16, 32, 32 },
+    { 0x100000000ULL, 0, 0, 0, 1 },
+    { 0x100000001ULL, 1, 1, 1, 2 },
+    { 0x123456789ULL, 3, 8, 14, 15 },
+    { 0x123456789abcdefULL, 7, 12, 20, 32 },
+    { 0x789abcdef0123456ULL, 4, 7, 13, 32 },
+    { 0x8000000000000000ULL, 0, 0, 0, 1 },
+    { 0x8000000000000001ULL, 1, 1, 1, 2 },
+    { 0xfffffffffffffffeULL, 7, 15, 31, 63 },
+    { 0xffffffffffffffffULL, 8, 16, 32, 64 },
+  };
+
+TEST_STDBIT_UI_TOPLEVEL (stdc_count_ones);
+
+static int
+do_test (void)
+{
+  TEST_STDBIT_UI (stdc_count_ones, inputs);
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/tests/from-glibc/tst-stdc_count_zeros.c b/tests/from-glibc/tst-stdc_count_zeros.c
new file mode 100644 (file)
index 0000000..cb72c83
--- /dev/null
@@ -0,0 +1,88 @@
+/* Test stdc_count_zeros functions and macros.
+   Copyright (C) 2024 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <tst-stdbit.h>
+
+static const struct stdbit_test inputs[] =
+  {
+    { 0ULL, 8, 16, 32, 64 },
+    { 0x1ULL, 7, 15, 31, 63 },
+    { 0x2ULL, 7, 15, 31, 63 },
+    { 0x3ULL, 6, 14, 30, 62 },
+    { 0x4ULL, 7, 15, 31, 63 },
+    { 0x5ULL, 6, 14, 30, 62 },
+    { 0x6ULL, 6, 14, 30, 62 },
+    { 0x7ULL, 5, 13, 29, 61 },
+    { 0x8ULL, 7, 15, 31, 63 },
+    { 0x9ULL, 6, 14, 30, 62 },
+    { 0xaULL, 6, 14, 30, 62 },
+    { 0xbULL, 5, 13, 29, 61 },
+    { 0xcULL, 6, 14, 30, 62 },
+    { 0xdULL, 5, 13, 29, 61 },
+    { 0xeULL, 5, 13, 29, 61 },
+    { 0xfULL, 4, 12, 28, 60 },
+    { 0x10ULL, 7, 15, 31, 63 },
+    { 0x11ULL, 6, 14, 30, 62 },
+    { 0x12ULL, 6, 14, 30, 62 },
+    { 0x1fULL, 3, 11, 27, 59 },
+    { 0x20ULL, 7, 15, 31, 63 },
+    { 0x7fULL, 1, 9, 25, 57 },
+    { 0x80ULL, 7, 15, 31, 63 },
+    { 0x81ULL, 6, 14, 30, 62 },
+    { 0x9aULL, 4, 12, 28, 60 },
+    { 0xf3ULL, 2, 10, 26, 58 },
+    { 0xffULL, 0, 8, 24, 56 },
+    { 0x100ULL, 8, 15, 31, 63 },
+    { 0x101ULL, 7, 14, 30, 62 },
+    { 0x102ULL, 7, 14, 30, 62 },
+    { 0x1feULL, 1, 8, 24, 56 },
+    { 0x1ffULL, 0, 7, 23, 55 },
+    { 0x200ULL, 8, 15, 31, 63 },
+    { 0x234ULL, 5, 12, 28, 60 },
+    { 0x4567ULL, 3, 8, 24, 56 },
+    { 0x7fffULL, 0, 1, 17, 49 },
+    { 0x8000ULL, 8, 15, 31, 63 },
+    { 0x8001ULL, 7, 14, 30, 62 },
+    { 0xfffeULL, 1, 1, 17, 49 },
+    { 0xffffULL, 0, 0, 16, 48 },
+    { 0x10000ULL, 8, 16, 31, 63 },
+    { 0x10001ULL, 7, 15, 30, 62 },
+    { 0xfedcba98ULL, 5, 8, 12, 44 },
+    { 0xfffffefeULL, 1, 2, 2, 34 },
+    { 0xffffffffULL, 0, 0, 0, 32 },
+    { 0x100000000ULL, 8, 16, 32, 63 },
+    { 0x100000001ULL, 7, 15, 31, 62 },
+    { 0x123456789ULL, 5, 8, 18, 49 },
+    { 0x123456789abcdefULL, 1, 4, 12, 32 },
+    { 0x789abcdef0123456ULL, 4, 9, 19, 32 },
+    { 0x8000000000000000ULL, 8, 16, 32, 63 },
+    { 0x8000000000000001ULL, 7, 15, 31, 62 },
+    { 0xfffffffffffffffeULL, 1, 1, 1, 1 },
+    { 0xffffffffffffffffULL, 0, 0, 0, 0 },
+  };
+
+TEST_STDBIT_UI_TOPLEVEL (stdc_count_zeros);
+
+static int
+do_test (void)
+{
+  TEST_STDBIT_UI (stdc_count_zeros, inputs);
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/tests/from-glibc/tst-stdc_first_leading_one.c b/tests/from-glibc/tst-stdc_first_leading_one.c
new file mode 100644 (file)
index 0000000..63f24bd
--- /dev/null
@@ -0,0 +1,88 @@
+/* Test stdc_first_leading_one functions and macros.
+   Copyright (C) 2024 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <tst-stdbit.h>
+
+static const struct stdbit_test inputs[] =
+  {
+    { 0ULL, 0, 0, 0, 0 },
+    { 0x1ULL, 8, 16, 32, 64 },
+    { 0x2ULL, 7, 15, 31, 63 },
+    { 0x3ULL, 7, 15, 31, 63 },
+    { 0x4ULL, 6, 14, 30, 62 },
+    { 0x5ULL, 6, 14, 30, 62 },
+    { 0x6ULL, 6, 14, 30, 62 },
+    { 0x7ULL, 6, 14, 30, 62 },
+    { 0x8ULL, 5, 13, 29, 61 },
+    { 0x9ULL, 5, 13, 29, 61 },
+    { 0xaULL, 5, 13, 29, 61 },
+    { 0xbULL, 5, 13, 29, 61 },
+    { 0xcULL, 5, 13, 29, 61 },
+    { 0xdULL, 5, 13, 29, 61 },
+    { 0xeULL, 5, 13, 29, 61 },
+    { 0xfULL, 5, 13, 29, 61 },
+    { 0x10ULL, 4, 12, 28, 60 },
+    { 0x11ULL, 4, 12, 28, 60 },
+    { 0x12ULL, 4, 12, 28, 60 },
+    { 0x1fULL, 4, 12, 28, 60 },
+    { 0x20ULL, 3, 11, 27, 59 },
+    { 0x7fULL, 2, 10, 26, 58 },
+    { 0x80ULL, 1, 9, 25, 57 },
+    { 0x81ULL, 1, 9, 25, 57 },
+    { 0x9aULL, 1, 9, 25, 57 },
+    { 0xf3ULL, 1, 9, 25, 57 },
+    { 0xffULL, 1, 9, 25, 57 },
+    { 0x100ULL, 0, 8, 24, 56 },
+    { 0x101ULL, 8, 8, 24, 56 },
+    { 0x102ULL, 7, 8, 24, 56 },
+    { 0x1feULL, 1, 8, 24, 56 },
+    { 0x1ffULL, 1, 8, 24, 56 },
+    { 0x200ULL, 0, 7, 23, 55 },
+    { 0x234ULL, 3, 7, 23, 55 },
+    { 0x4567ULL, 2, 2, 18, 50 },
+    { 0x7fffULL, 1, 2, 18, 50 },
+    { 0x8000ULL, 0, 1, 17, 49 },
+    { 0x8001ULL, 8, 1, 17, 49 },
+    { 0xfffeULL, 1, 1, 17, 49 },
+    { 0xffffULL, 1, 1, 17, 49 },
+    { 0x10000ULL, 0, 0, 16, 48 },
+    { 0x10001ULL, 8, 16, 16, 48 },
+    { 0xfedcba98ULL, 1, 1, 1, 33 },
+    { 0xfffffefeULL, 1, 1, 1, 33 },
+    { 0xffffffffULL, 1, 1, 1, 33 },
+    { 0x100000000ULL, 0, 0, 0, 32 },
+    { 0x100000001ULL, 8, 16, 32, 32 },
+    { 0x123456789ULL, 1, 2, 3, 32 },
+    { 0x123456789abcdefULL, 1, 1, 1, 8 },
+    { 0x789abcdef0123456ULL, 2, 3, 1, 2 },
+    { 0x8000000000000000ULL, 0, 0, 0, 1 },
+    { 0x8000000000000001ULL, 8, 16, 32, 1 },
+    { 0xfffffffffffffffeULL, 1, 1, 1, 1 },
+    { 0xffffffffffffffffULL, 1, 1, 1, 1 },
+  };
+
+TEST_STDBIT_UI_TOPLEVEL (stdc_first_leading_one);
+
+static int
+do_test (void)
+{
+  TEST_STDBIT_UI (stdc_first_leading_one, inputs);
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/tests/from-glibc/tst-stdc_first_leading_zero.c b/tests/from-glibc/tst-stdc_first_leading_zero.c
new file mode 100644 (file)
index 0000000..b9d1167
--- /dev/null
@@ -0,0 +1,88 @@
+/* Test stdc_first_leading_zero functions and macros.
+   Copyright (C) 2024 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <tst-stdbit.h>
+
+static const struct stdbit_test inputs[] =
+  {
+    { 0ULL, 1, 1, 1, 1 },
+    { 0x1ULL, 1, 1, 1, 1 },
+    { 0x2ULL, 1, 1, 1, 1 },
+    { 0x3ULL, 1, 1, 1, 1 },
+    { 0x4ULL, 1, 1, 1, 1 },
+    { 0x5ULL, 1, 1, 1, 1 },
+    { 0x6ULL, 1, 1, 1, 1 },
+    { 0x7ULL, 1, 1, 1, 1 },
+    { 0x8ULL, 1, 1, 1, 1 },
+    { 0x9ULL, 1, 1, 1, 1 },
+    { 0xaULL, 1, 1, 1, 1 },
+    { 0xbULL, 1, 1, 1, 1 },
+    { 0xcULL, 1, 1, 1, 1 },
+    { 0xdULL, 1, 1, 1, 1 },
+    { 0xeULL, 1, 1, 1, 1 },
+    { 0xfULL, 1, 1, 1, 1 },
+    { 0x10ULL, 1, 1, 1, 1 },
+    { 0x11ULL, 1, 1, 1, 1 },
+    { 0x12ULL, 1, 1, 1, 1 },
+    { 0x1fULL, 1, 1, 1, 1 },
+    { 0x20ULL, 1, 1, 1, 1 },
+    { 0x7fULL, 1, 1, 1, 1 },
+    { 0x80ULL, 2, 1, 1, 1 },
+    { 0x81ULL, 2, 1, 1, 1 },
+    { 0x9aULL, 2, 1, 1, 1 },
+    { 0xf3ULL, 5, 1, 1, 1 },
+    { 0xffULL, 0, 1, 1, 1 },
+    { 0x100ULL, 1, 1, 1, 1 },
+    { 0x101ULL, 1, 1, 1, 1 },
+    { 0x102ULL, 1, 1, 1, 1 },
+    { 0x1feULL, 8, 1, 1, 1 },
+    { 0x1ffULL, 0, 1, 1, 1 },
+    { 0x200ULL, 1, 1, 1, 1 },
+    { 0x234ULL, 1, 1, 1, 1 },
+    { 0x4567ULL, 1, 1, 1, 1 },
+    { 0x7fffULL, 0, 1, 1, 1 },
+    { 0x8000ULL, 1, 2, 1, 1 },
+    { 0x8001ULL, 1, 2, 1, 1 },
+    { 0xfffeULL, 8, 16, 1, 1 },
+    { 0xffffULL, 0, 0, 1, 1 },
+    { 0x10000ULL, 1, 1, 1, 1 },
+    { 0x10001ULL, 1, 1, 1, 1 },
+    { 0xfedcba98ULL, 2, 2, 8, 1 },
+    { 0xfffffefeULL, 8, 8, 24, 1 },
+    { 0xffffffffULL, 0, 0, 0, 1 },
+    { 0x100000000ULL, 1, 1, 1, 1 },
+    { 0x100000001ULL, 1, 1, 1, 1 },
+    { 0x123456789ULL, 2, 1, 1, 1 },
+    { 0x123456789abcdefULL, 4, 3, 2, 1 },
+    { 0x789abcdef0123456ULL, 1, 1, 5, 1 },
+    { 0x8000000000000000ULL, 1, 1, 1, 2 },
+    { 0x8000000000000001ULL, 1, 1, 1, 2 },
+    { 0xfffffffffffffffeULL, 8, 16, 32, 64 },
+    { 0xffffffffffffffffULL, 0, 0, 0, 0 },
+  };
+
+TEST_STDBIT_UI_TOPLEVEL (stdc_first_leading_zero);
+
+static int
+do_test (void)
+{
+  TEST_STDBIT_UI (stdc_first_leading_zero, inputs);
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/tests/from-glibc/tst-stdc_first_trailing_one.c b/tests/from-glibc/tst-stdc_first_trailing_one.c
new file mode 100644 (file)
index 0000000..d4eeb22
--- /dev/null
@@ -0,0 +1,88 @@
+/* Test stdc_first_trailing_one functions and macros.
+   Copyright (C) 2024 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <tst-stdbit.h>
+
+static const struct stdbit_test inputs[] =
+  {
+    { 0ULL, 0, 0, 0, 0 },
+    { 0x1ULL, 1, 1, 1, 1 },
+    { 0x2ULL, 2, 2, 2, 2 },
+    { 0x3ULL, 1, 1, 1, 1 },
+    { 0x4ULL, 3, 3, 3, 3 },
+    { 0x5ULL, 1, 1, 1, 1 },
+    { 0x6ULL, 2, 2, 2, 2 },
+    { 0x7ULL, 1, 1, 1, 1 },
+    { 0x8ULL, 4, 4, 4, 4 },
+    { 0x9ULL, 1, 1, 1, 1 },
+    { 0xaULL, 2, 2, 2, 2 },
+    { 0xbULL, 1, 1, 1, 1 },
+    { 0xcULL, 3, 3, 3, 3 },
+    { 0xdULL, 1, 1, 1, 1 },
+    { 0xeULL, 2, 2, 2, 2 },
+    { 0xfULL, 1, 1, 1, 1 },
+    { 0x10ULL, 5, 5, 5, 5 },
+    { 0x11ULL, 1, 1, 1, 1 },
+    { 0x12ULL, 2, 2, 2, 2 },
+    { 0x1fULL, 1, 1, 1, 1 },
+    { 0x20ULL, 6, 6, 6, 6 },
+    { 0x7fULL, 1, 1, 1, 1 },
+    { 0x80ULL, 8, 8, 8, 8 },
+    { 0x81ULL, 1, 1, 1, 1 },
+    { 0x9aULL, 2, 2, 2, 2 },
+    { 0xf3ULL, 1, 1, 1, 1 },
+    { 0xffULL, 1, 1, 1, 1 },
+    { 0x100ULL, 0, 9, 9, 9 },
+    { 0x101ULL, 1, 1, 1, 1 },
+    { 0x102ULL, 2, 2, 2, 2 },
+    { 0x1feULL, 2, 2, 2, 2 },
+    { 0x1ffULL, 1, 1, 1, 1 },
+    { 0x200ULL, 0, 10, 10, 10 },
+    { 0x234ULL, 3, 3, 3, 3 },
+    { 0x4567ULL, 1, 1, 1, 1 },
+    { 0x7fffULL, 1, 1, 1, 1 },
+    { 0x8000ULL, 0, 16, 16, 16 },
+    { 0x8001ULL, 1, 1, 1, 1 },
+    { 0xfffeULL, 2, 2, 2, 2 },
+    { 0xffffULL, 1, 1, 1, 1 },
+    { 0x10000ULL, 0, 0, 17, 17 },
+    { 0x10001ULL, 1, 1, 1, 1 },
+    { 0xfedcba98ULL, 4, 4, 4, 4 },
+    { 0xfffffefeULL, 2, 2, 2, 2 },
+    { 0xffffffffULL, 1, 1, 1, 1 },
+    { 0x100000000ULL, 0, 0, 0, 33 },
+    { 0x100000001ULL, 1, 1, 1, 1 },
+    { 0x123456789ULL, 1, 1, 1, 1 },
+    { 0x123456789abcdefULL, 1, 1, 1, 1 },
+    { 0x789abcdef0123456ULL, 2, 2, 2, 2 },
+    { 0x8000000000000000ULL, 0, 0, 0, 64 },
+    { 0x8000000000000001ULL, 1, 1, 1, 1 },
+    { 0xfffffffffffffffeULL, 2, 2, 2, 2 },
+    { 0xffffffffffffffffULL, 1, 1, 1, 1 },
+  };
+
+TEST_STDBIT_UI_TOPLEVEL (stdc_first_trailing_one);
+
+static int
+do_test (void)
+{
+  TEST_STDBIT_UI (stdc_first_trailing_one, inputs);
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/tests/from-glibc/tst-stdc_first_trailing_zero.c b/tests/from-glibc/tst-stdc_first_trailing_zero.c
new file mode 100644 (file)
index 0000000..4a804e2
--- /dev/null
@@ -0,0 +1,88 @@
+/* Test stdc_first_trailing_zero functions and macros.
+   Copyright (C) 2024 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <tst-stdbit.h>
+
+static const struct stdbit_test inputs[] =
+  {
+    { 0ULL, 1, 1, 1, 1 },
+    { 0x1ULL, 2, 2, 2, 2 },
+    { 0x2ULL, 1, 1, 1, 1 },
+    { 0x3ULL, 3, 3, 3, 3 },
+    { 0x4ULL, 1, 1, 1, 1 },
+    { 0x5ULL, 2, 2, 2, 2 },
+    { 0x6ULL, 1, 1, 1, 1 },
+    { 0x7ULL, 4, 4, 4, 4 },
+    { 0x8ULL, 1, 1, 1, 1 },
+    { 0x9ULL, 2, 2, 2, 2 },
+    { 0xaULL, 1, 1, 1, 1 },
+    { 0xbULL, 3, 3, 3, 3 },
+    { 0xcULL, 1, 1, 1, 1 },
+    { 0xdULL, 2, 2, 2, 2 },
+    { 0xeULL, 1, 1, 1, 1 },
+    { 0xfULL, 5, 5, 5, 5 },
+    { 0x10ULL, 1, 1, 1, 1 },
+    { 0x11ULL, 2, 2, 2, 2 },
+    { 0x12ULL, 1, 1, 1, 1 },
+    { 0x1fULL, 6, 6, 6, 6 },
+    { 0x20ULL, 1, 1, 1, 1 },
+    { 0x7fULL, 8, 8, 8, 8 },
+    { 0x80ULL, 1, 1, 1, 1 },
+    { 0x81ULL, 2, 2, 2, 2 },
+    { 0x9aULL, 1, 1, 1, 1 },
+    { 0xf3ULL, 3, 3, 3, 3 },
+    { 0xffULL, 0, 9, 9, 9 },
+    { 0x100ULL, 1, 1, 1, 1 },
+    { 0x101ULL, 2, 2, 2, 2 },
+    { 0x102ULL, 1, 1, 1, 1 },
+    { 0x1feULL, 1, 1, 1, 1 },
+    { 0x1ffULL, 0, 10, 10, 10 },
+    { 0x200ULL, 1, 1, 1, 1 },
+    { 0x234ULL, 1, 1, 1, 1 },
+    { 0x4567ULL, 4, 4, 4, 4 },
+    { 0x7fffULL, 0, 16, 16, 16 },
+    { 0x8000ULL, 1, 1, 1, 1 },
+    { 0x8001ULL, 2, 2, 2, 2 },
+    { 0xfffeULL, 1, 1, 1, 1 },
+    { 0xffffULL, 0, 0, 17, 17 },
+    { 0x10000ULL, 1, 1, 1, 1 },
+    { 0x10001ULL, 2, 2, 2, 2 },
+    { 0xfedcba98ULL, 1, 1, 1, 1 },
+    { 0xfffffefeULL, 1, 1, 1, 1 },
+    { 0xffffffffULL, 0, 0, 0, 33 },
+    { 0x100000000ULL, 1, 1, 1, 1 },
+    { 0x100000001ULL, 2, 2, 2, 2 },
+    { 0x123456789ULL, 2, 2, 2, 2 },
+    { 0x123456789abcdefULL, 5, 5, 5, 5 },
+    { 0x789abcdef0123456ULL, 1, 1, 1, 1 },
+    { 0x8000000000000000ULL, 1, 1, 1, 1 },
+    { 0x8000000000000001ULL, 2, 2, 2, 2 },
+    { 0xfffffffffffffffeULL, 1, 1, 1, 1 },
+    { 0xffffffffffffffffULL, 0, 0, 0, 0 },
+  };
+
+TEST_STDBIT_UI_TOPLEVEL (stdc_first_trailing_zero);
+
+static int
+do_test (void)
+{
+  TEST_STDBIT_UI (stdc_first_trailing_zero, inputs);
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/tests/from-glibc/tst-stdc_has_single_bit.c b/tests/from-glibc/tst-stdc_has_single_bit.c
new file mode 100644 (file)
index 0000000..2a2c855
--- /dev/null
@@ -0,0 +1,88 @@
+/* Test stdc_has_single_bit functions and macros.
+   Copyright (C) 2024 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <tst-stdbit.h>
+
+static const struct stdbit_test inputs[] =
+  {
+    { 0ULL, false, false, false, false },
+    { 0x1ULL, true, true, true, true },
+    { 0x2ULL, true, true, true, true },
+    { 0x3ULL, false, false, false, false },
+    { 0x4ULL, true, true, true, true },
+    { 0x5ULL, false, false, false, false },
+    { 0x6ULL, false, false, false, false },
+    { 0x7ULL, false, false, false, false },
+    { 0x8ULL, true, true, true, true },
+    { 0x9ULL, false, false, false, false },
+    { 0xaULL, false, false, false, false },
+    { 0xbULL, false, false, false, false },
+    { 0xcULL, false, false, false, false },
+    { 0xdULL, false, false, false, false },
+    { 0xeULL, false, false, false, false },
+    { 0xfULL, false, false, false, false },
+    { 0x10ULL, true, true, true, true },
+    { 0x11ULL, false, false, false, false },
+    { 0x12ULL, false, false, false, false },
+    { 0x1fULL, false, false, false, false },
+    { 0x20ULL, true, true, true, true },
+    { 0x7fULL, false, false, false, false },
+    { 0x80ULL, true, true, true, true },
+    { 0x81ULL, false, false, false, false },
+    { 0x9aULL, false, false, false, false },
+    { 0xf3ULL, false, false, false, false },
+    { 0xffULL, false, false, false, false },
+    { 0x100ULL, false, true, true, true },
+    { 0x101ULL, true, false, false, false },
+    { 0x102ULL, true, false, false, false },
+    { 0x1feULL, false, false, false, false },
+    { 0x1ffULL, false, false, false, false },
+    { 0x200ULL, false, true, true, true },
+    { 0x234ULL, false, false, false, false },
+    { 0x4567ULL, false, false, false, false },
+    { 0x7fffULL, false, false, false, false },
+    { 0x8000ULL, false, true, true, true },
+    { 0x8001ULL, true, false, false, false },
+    { 0xfffeULL, false, false, false, false },
+    { 0xffffULL, false, false, false, false },
+    { 0x10000ULL, false, false, true, true },
+    { 0x10001ULL, true, true, false, false },
+    { 0xfedcba98ULL, false, false, false, false },
+    { 0xfffffefeULL, false, false, false, false },
+    { 0xffffffffULL, false, false, false, false },
+    { 0x100000000ULL, false, false, false, true },
+    { 0x100000001ULL, true, true, true, false },
+    { 0x123456789ULL, false, false, false, false },
+    { 0x123456789abcdefULL, false, false, false, false },
+    { 0x789abcdef0123456ULL, false, false, false, false },
+    { 0x8000000000000000ULL, false, false, false, true },
+    { 0x8000000000000001ULL, true, true, true, false },
+    { 0xfffffffffffffffeULL, false, false, false, false },
+    { 0xffffffffffffffffULL, false, false, false, false },
+  };
+
+TEST_STDBIT_BOOL_TOPLEVEL (stdc_has_single_bit);
+
+static int
+do_test (void)
+{
+  TEST_STDBIT_BOOL (stdc_has_single_bit, inputs);
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/tests/from-glibc/tst-stdc_leading_ones.c b/tests/from-glibc/tst-stdc_leading_ones.c
new file mode 100644 (file)
index 0000000..8d8ccd5
--- /dev/null
@@ -0,0 +1,88 @@
+/* Test stdc_leading_ones functions and macros.
+   Copyright (C) 2024 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <tst-stdbit.h>
+
+static const struct stdbit_test inputs[] =
+  {
+    { 0ULL, 0, 0, 0, 0 },
+    { 0x1ULL, 0, 0, 0, 0 },
+    { 0x2ULL, 0, 0, 0, 0 },
+    { 0x3ULL, 0, 0, 0, 0 },
+    { 0x4ULL, 0, 0, 0, 0 },
+    { 0x5ULL, 0, 0, 0, 0 },
+    { 0x6ULL, 0, 0, 0, 0 },
+    { 0x7ULL, 0, 0, 0, 0 },
+    { 0x8ULL, 0, 0, 0, 0 },
+    { 0x9ULL, 0, 0, 0, 0 },
+    { 0xaULL, 0, 0, 0, 0 },
+    { 0xbULL, 0, 0, 0, 0 },
+    { 0xcULL, 0, 0, 0, 0 },
+    { 0xdULL, 0, 0, 0, 0 },
+    { 0xeULL, 0, 0, 0, 0 },
+    { 0xfULL, 0, 0, 0, 0 },
+    { 0x10ULL, 0, 0, 0, 0 },
+    { 0x11ULL, 0, 0, 0, 0 },
+    { 0x12ULL, 0, 0, 0, 0 },
+    { 0x1fULL, 0, 0, 0, 0 },
+    { 0x20ULL, 0, 0, 0, 0 },
+    { 0x7fULL, 0, 0, 0, 0 },
+    { 0x80ULL, 1, 0, 0, 0 },
+    { 0x81ULL, 1, 0, 0, 0 },
+    { 0x9aULL, 1, 0, 0, 0 },
+    { 0xf3ULL, 4, 0, 0, 0 },
+    { 0xffULL, 8, 0, 0, 0 },
+    { 0x100ULL, 0, 0, 0, 0 },
+    { 0x101ULL, 0, 0, 0, 0 },
+    { 0x102ULL, 0, 0, 0, 0 },
+    { 0x1feULL, 7, 0, 0, 0 },
+    { 0x1ffULL, 8, 0, 0, 0 },
+    { 0x200ULL, 0, 0, 0, 0 },
+    { 0x234ULL, 0, 0, 0, 0 },
+    { 0x4567ULL, 0, 0, 0, 0 },
+    { 0x7fffULL, 8, 0, 0, 0 },
+    { 0x8000ULL, 0, 1, 0, 0 },
+    { 0x8001ULL, 0, 1, 0, 0 },
+    { 0xfffeULL, 7, 15, 0, 0 },
+    { 0xffffULL, 8, 16, 0, 0 },
+    { 0x10000ULL, 0, 0, 0, 0 },
+    { 0x10001ULL, 0, 0, 0, 0 },
+    { 0xfedcba98ULL, 1, 1, 7, 0 },
+    { 0xfffffefeULL, 7, 7, 23, 0 },
+    { 0xffffffffULL, 8, 16, 32, 0 },
+    { 0x100000000ULL, 0, 0, 0, 0 },
+    { 0x100000001ULL, 0, 0, 0, 0 },
+    { 0x123456789ULL, 1, 0, 0, 0 },
+    { 0x123456789abcdefULL, 3, 2, 1, 0 },
+    { 0x789abcdef0123456ULL, 0, 0, 4, 0 },
+    { 0x8000000000000000ULL, 0, 0, 0, 1 },
+    { 0x8000000000000001ULL, 0, 0, 0, 1 },
+    { 0xfffffffffffffffeULL, 7, 15, 31, 63 },
+    { 0xffffffffffffffffULL, 8, 16, 32, 64 },
+  };
+
+TEST_STDBIT_UI_TOPLEVEL (stdc_leading_ones);
+
+static int
+do_test (void)
+{
+  TEST_STDBIT_UI (stdc_leading_ones, inputs);
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/tests/from-glibc/tst-stdc_leading_zeros.c b/tests/from-glibc/tst-stdc_leading_zeros.c
new file mode 100644 (file)
index 0000000..3452908
--- /dev/null
@@ -0,0 +1,88 @@
+/* Test stdc_leading_zeros functions and macros.
+   Copyright (C) 2024 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <tst-stdbit.h>
+
+static const struct stdbit_test inputs[] =
+  {
+    { 0ULL, 8, 16, 32, 64 },
+    { 0x1ULL, 7, 15, 31, 63 },
+    { 0x2ULL, 6, 14, 30, 62 },
+    { 0x3ULL, 6, 14, 30, 62 },
+    { 0x4ULL, 5, 13, 29, 61 },
+    { 0x5ULL, 5, 13, 29, 61 },
+    { 0x6ULL, 5, 13, 29, 61 },
+    { 0x7ULL, 5, 13, 29, 61 },
+    { 0x8ULL, 4, 12, 28, 60 },
+    { 0x9ULL, 4, 12, 28, 60 },
+    { 0xaULL, 4, 12, 28, 60 },
+    { 0xbULL, 4, 12, 28, 60 },
+    { 0xcULL, 4, 12, 28, 60 },
+    { 0xdULL, 4, 12, 28, 60 },
+    { 0xeULL, 4, 12, 28, 60 },
+    { 0xfULL, 4, 12, 28, 60 },
+    { 0x10ULL, 3, 11, 27, 59 },
+    { 0x11ULL, 3, 11, 27, 59 },
+    { 0x12ULL, 3, 11, 27, 59 },
+    { 0x1fULL, 3, 11, 27, 59 },
+    { 0x20ULL, 2, 10, 26, 58 },
+    { 0x7fULL, 1, 9, 25, 57 },
+    { 0x80ULL, 0, 8, 24, 56 },
+    { 0x81ULL, 0, 8, 24, 56 },
+    { 0x9aULL, 0, 8, 24, 56 },
+    { 0xf3ULL, 0, 8, 24, 56 },
+    { 0xffULL, 0, 8, 24, 56 },
+    { 0x100ULL, 8, 7, 23, 55 },
+    { 0x101ULL, 7, 7, 23, 55 },
+    { 0x102ULL, 6, 7, 23, 55 },
+    { 0x1feULL, 0, 7, 23, 55 },
+    { 0x1ffULL, 0, 7, 23, 55 },
+    { 0x200ULL, 8, 6, 22, 54 },
+    { 0x234ULL, 2, 6, 22, 54 },
+    { 0x4567ULL, 1, 1, 17, 49 },
+    { 0x7fffULL, 0, 1, 17, 49 },
+    { 0x8000ULL, 8, 0, 16, 48 },
+    { 0x8001ULL, 7, 0, 16, 48 },
+    { 0xfffeULL, 0, 0, 16, 48 },
+    { 0xffffULL, 0, 0, 16, 48 },
+    { 0x10000ULL, 8, 16, 15, 47 },
+    { 0x10001ULL, 7, 15, 15, 47 },
+    { 0xfedcba98ULL, 0, 0, 0, 32 },
+    { 0xfffffefeULL, 0, 0, 0, 32 },
+    { 0xffffffffULL, 0, 0, 0, 32 },
+    { 0x100000000ULL, 8, 16, 32, 31 },
+    { 0x100000001ULL, 7, 15, 31, 31 },
+    { 0x123456789ULL, 0, 1, 2, 31 },
+    { 0x123456789abcdefULL, 0, 0, 0, 7 },
+    { 0x789abcdef0123456ULL, 1, 2, 0, 1 },
+    { 0x8000000000000000ULL, 8, 16, 32, 0 },
+    { 0x8000000000000001ULL, 7, 15, 31, 0 },
+    { 0xfffffffffffffffeULL, 0, 0, 0, 0 },
+    { 0xffffffffffffffffULL, 0, 0, 0, 0 },
+  };
+
+TEST_STDBIT_UI_TOPLEVEL (stdc_leading_zeros);
+
+static int
+do_test (void)
+{
+  TEST_STDBIT_UI (stdc_leading_zeros, inputs);
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/tests/from-glibc/tst-stdc_trailing_ones.c b/tests/from-glibc/tst-stdc_trailing_ones.c
new file mode 100644 (file)
index 0000000..6fcd9d8
--- /dev/null
@@ -0,0 +1,88 @@
+/* Test stdc_trailing_ones functions and macros.
+   Copyright (C) 2024 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <tst-stdbit.h>
+
+static const struct stdbit_test inputs[] =
+  {
+    { 0ULL, 0, 0, 0, 0 },
+    { 0x1ULL, 1, 1, 1, 1 },
+    { 0x2ULL, 0, 0, 0, 0 },
+    { 0x3ULL, 2, 2, 2, 2 },
+    { 0x4ULL, 0, 0, 0, 0 },
+    { 0x5ULL, 1, 1, 1, 1 },
+    { 0x6ULL, 0, 0, 0, 0 },
+    { 0x7ULL, 3, 3, 3, 3 },
+    { 0x8ULL, 0, 0, 0, 0 },
+    { 0x9ULL, 1, 1, 1, 1 },
+    { 0xaULL, 0, 0, 0, 0 },
+    { 0xbULL, 2, 2, 2, 2 },
+    { 0xcULL, 0, 0, 0, 0 },
+    { 0xdULL, 1, 1, 1, 1 },
+    { 0xeULL, 0, 0, 0, 0 },
+    { 0xfULL, 4, 4, 4, 4 },
+    { 0x10ULL, 0, 0, 0, 0 },
+    { 0x11ULL, 1, 1, 1, 1 },
+    { 0x12ULL, 0, 0, 0, 0 },
+    { 0x1fULL, 5, 5, 5, 5 },
+    { 0x20ULL, 0, 0, 0, 0 },
+    { 0x7fULL, 7, 7, 7, 7 },
+    { 0x80ULL, 0, 0, 0, 0 },
+    { 0x81ULL, 1, 1, 1, 1 },
+    { 0x9aULL, 0, 0, 0, 0 },
+    { 0xf3ULL, 2, 2, 2, 2 },
+    { 0xffULL, 8, 8, 8, 8 },
+    { 0x100ULL, 0, 0, 0, 0 },
+    { 0x101ULL, 1, 1, 1, 1 },
+    { 0x102ULL, 0, 0, 0, 0 },
+    { 0x1feULL, 0, 0, 0, 0 },
+    { 0x1ffULL, 8, 9, 9, 9 },
+    { 0x200ULL, 0, 0, 0, 0 },
+    { 0x234ULL, 0, 0, 0, 0 },
+    { 0x4567ULL, 3, 3, 3, 3 },
+    { 0x7fffULL, 8, 15, 15, 15 },
+    { 0x8000ULL, 0, 0, 0, 0 },
+    { 0x8001ULL, 1, 1, 1, 1 },
+    { 0xfffeULL, 0, 0, 0, 0 },
+    { 0xffffULL, 8, 16, 16, 16 },
+    { 0x10000ULL, 0, 0, 0, 0 },
+    { 0x10001ULL, 1, 1, 1, 1 },
+    { 0xfedcba98ULL, 0, 0, 0, 0 },
+    { 0xfffffefeULL, 0, 0, 0, 0 },
+    { 0xffffffffULL, 8, 16, 32, 32 },
+    { 0x100000000ULL, 0, 0, 0, 0 },
+    { 0x100000001ULL, 1, 1, 1, 1 },
+    { 0x123456789ULL, 1, 1, 1, 1 },
+    { 0x123456789abcdefULL, 4, 4, 4, 4 },
+    { 0x789abcdef0123456ULL, 0, 0, 0, 0 },
+    { 0x8000000000000000ULL, 0, 0, 0, 0 },
+    { 0x8000000000000001ULL, 1, 1, 1, 1 },
+    { 0xfffffffffffffffeULL, 0, 0, 0, 0 },
+    { 0xffffffffffffffffULL, 8, 16, 32, 64 },
+  };
+
+TEST_STDBIT_UI_TOPLEVEL (stdc_trailing_ones);
+
+static int
+do_test (void)
+{
+  TEST_STDBIT_UI (stdc_trailing_ones, inputs);
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/tests/from-glibc/tst-stdc_trailing_zeros.c b/tests/from-glibc/tst-stdc_trailing_zeros.c
new file mode 100644 (file)
index 0000000..a7664ee
--- /dev/null
@@ -0,0 +1,88 @@
+/* Test stdc_trailing_zeros functions and macros.
+   Copyright (C) 2024 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
+   <https://www.gnu.org/licenses/>.  */
+
+#include <tst-stdbit.h>
+
+static const struct stdbit_test inputs[] =
+  {
+    { 0ULL, 8, 16, 32, 64 },
+    { 0x1ULL, 0, 0, 0, 0 },
+    { 0x2ULL, 1, 1, 1, 1 },
+    { 0x3ULL, 0, 0, 0, 0 },
+    { 0x4ULL, 2, 2, 2, 2 },
+    { 0x5ULL, 0, 0, 0, 0 },
+    { 0x6ULL, 1, 1, 1, 1 },
+    { 0x7ULL, 0, 0, 0, 0 },
+    { 0x8ULL, 3, 3, 3, 3 },
+    { 0x9ULL, 0, 0, 0, 0 },
+    { 0xaULL, 1, 1, 1, 1 },
+    { 0xbULL, 0, 0, 0, 0 },
+    { 0xcULL, 2, 2, 2, 2 },
+    { 0xdULL, 0, 0, 0, 0 },
+    { 0xeULL, 1, 1, 1, 1 },
+    { 0xfULL, 0, 0, 0, 0 },
+    { 0x10ULL, 4, 4, 4, 4 },
+    { 0x11ULL, 0, 0, 0, 0 },
+    { 0x12ULL, 1, 1, 1, 1 },
+    { 0x1fULL, 0, 0, 0, 0 },
+    { 0x20ULL, 5, 5, 5, 5 },
+    { 0x7fULL, 0, 0, 0, 0 },
+    { 0x80ULL, 7, 7, 7, 7 },
+    { 0x81ULL, 0, 0, 0, 0 },
+    { 0x9aULL, 1, 1, 1, 1 },
+    { 0xf3ULL, 0, 0, 0, 0 },
+    { 0xffULL, 0, 0, 0, 0 },
+    { 0x100ULL, 8, 8, 8, 8 },
+    { 0x101ULL, 0, 0, 0, 0 },
+    { 0x102ULL, 1, 1, 1, 1 },
+    { 0x1feULL, 1, 1, 1, 1 },
+    { 0x1ffULL, 0, 0, 0, 0 },
+    { 0x200ULL, 8, 9, 9, 9 },
+    { 0x234ULL, 2, 2, 2, 2 },
+    { 0x4567ULL, 0, 0, 0, 0 },
+    { 0x7fffULL, 0, 0, 0, 0 },
+    { 0x8000ULL, 8, 15, 15, 15 },
+    { 0x8001ULL, 0, 0, 0, 0 },
+    { 0xfffeULL, 1, 1, 1, 1 },
+    { 0xffffULL, 0, 0, 0, 0 },
+    { 0x10000ULL, 8, 16, 16, 16 },
+    { 0x10001ULL, 0, 0, 0, 0 },
+    { 0xfedcba98ULL, 3, 3, 3, 3 },
+    { 0xfffffefeULL, 1, 1, 1, 1 },
+    { 0xffffffffULL, 0, 0, 0, 0 },
+    { 0x100000000ULL, 8, 16, 32, 32 },
+    { 0x100000001ULL, 0, 0, 0, 0 },
+    { 0x123456789ULL, 0, 0, 0, 0 },
+    { 0x123456789abcdefULL, 0, 0, 0, 0 },
+    { 0x789abcdef0123456ULL, 1, 1, 1, 1 },
+    { 0x8000000000000000ULL, 8, 16, 32, 63 },
+    { 0x8000000000000001ULL, 0, 0, 0, 0 },
+    { 0xfffffffffffffffeULL, 1, 1, 1, 1 },
+    { 0xffffffffffffffffULL, 0, 0, 0, 0 },
+  };
+
+TEST_STDBIT_UI_TOPLEVEL (stdc_trailing_zeros);
+
+static int
+do_test (void)
+{
+  TEST_STDBIT_UI (stdc_trailing_zeros, inputs);
+  return 0;
+}
+
+#include <support/test-driver.c>
diff --git a/tests/support/test-driver.c b/tests/support/test-driver.c
deleted file mode 100644 (file)
index 84ac82e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-int
-main (void)
-{
-  return do_test ();
-}
diff --git a/tests/tst-stdbit.h b/tests/tst-stdbit.h
deleted file mode 100644 (file)
index 0a0ab6b..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-/* Common test support for <stdbit.h> tests.
-   Copyright (C) 2024 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
-   <https://www.gnu.org/licenses/>.  */
-
-#ifndef _TST_STDBIT_H
-#define _TST_STDBIT_H
-
-#if GNULIB_TEST_STDBIT
-# include <libc-config.h>
-#endif
-
-#include <stdbit.h>
-#include <stdbool.h>
-
-#if !GNULIB_TEST_STDBIT
-# include <array_length.h>
-# include <support/check.h>
-#else
-# include <stdint.h>
-# include <macros.h>
-# define array_length(a) (sizeof (a) / sizeof *(a))
-# define TEST_COMPARE(a, b) ASSERT ((a) == (b))
-#endif
-
-struct stdbit_test
-{
-  /* The test input.  */
-  uint64_t x;
-  /* Expected results if that test input is converted to 8, 16, 32 or
-     64 bits and then passed to the function under test for that
-     width.  */
-  uint64_t res_8, res_16, res_32, res_64;
-};
-
-#if !GNULIB_TEST_STDBIT
-# define TEST_TYPE(EXPR, TYPE)                                         \
-  _Static_assert (_Generic ((EXPR), TYPE: 1, default: 0), "bad type")
-#elif ((defined __GNUC__ && 2 <= __GNUC__) \
-       || (defined __clang_major__ && 4 <= __clang_major__) \
-       || (defined __IBMC__ && 1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
-       || (defined __SUNPRO_C && 0x5110 <= __SUNPRO_C && !__STDC__) \
-       || 202311 <= __STDC_VERSION__)
-# if __HAVE_GENERIC_SELECTION
-#  define TEST_TYPE(EXPR, TYPE) \
-    static_assert (_Generic (EXPR, TYPE: 1, default: 0))
-# else
-#  define TEST_TYPE(EXPR, TYPE) static_assert (sizeof (EXPR) == sizeof (TYPE))
-# endif
-#else
-/* A pre-C11 platform that lacks typeof.  */
-# define TEST_TYPE(EXPR, TYPE) static_assert (sizeof (TYPE) <= sizeof (EXPR))
-#endif
-
-/* Test a <stdbit.h> function / macro.  For each function family, and
-   each input type, we test both with and without macros from the
-   header being used, both with a possibly wider argument being passed
-   (that must be truncated by the prototype) and with the argument
-   truncated in the caller, as well as testing the type-generic macro
-   (with the argument truncated in the caller).  Also test that the
-   results have the correct type; also test truncation from
-   floating-point arguments (valid for functions, including with macro
-   expansion, because the prototype must implicitly convert to integer
-   type; not valid for the type-generic macros).  Also test that the
-   argument is evaluated exactly once.  Also test the macros are
-   usable (e.g. in typeof) at top level (GCC doesn't allow ({})
-   outside functions: bug 93239).  */
-
-#define TEST_STDBIT_T(FUNC, X, RES, TTYPE, TYPE, SUFFIX)               \
-  do                                                                   \
-    {                                                                  \
-      TEST_COMPARE (FUNC ## SUFFIX (X), (RES));                                \
-      TEST_TYPE (FUNC ## SUFFIX (X), TTYPE);                           \
-      TEST_COMPARE ((FUNC ## SUFFIX) (X), (RES));                      \
-      TEST_TYPE ((FUNC ## SUFFIX) (X), TTYPE);                         \
-      TEST_COMPARE (FUNC ## SUFFIX ((TYPE) (X)), (RES));               \
-      TEST_TYPE (FUNC ## SUFFIX ((TYPE) (X)), TTYPE);                  \
-      TEST_COMPARE ((FUNC ## SUFFIX) ((TYPE) (X)), (RES));             \
-      TEST_TYPE ((FUNC ## SUFFIX) ((TYPE) (X)), TTYPE);                        \
-      TEST_COMPARE (FUNC ((TYPE) (X)), (RES));                         \
-      TEST_TYPE (FUNC ((TYPE) (X)), TTYPE);                            \
-      if (sizeof (TYPE) <= 2)                                          \
-       {                                                               \
-         TEST_COMPARE (FUNC ## SUFFIX ((float) (TYPE) (X)), (RES));    \
-         TEST_TYPE (FUNC ## SUFFIX ((float) (TYPE) (X)), TTYPE);       \
-         TEST_COMPARE ((FUNC ## SUFFIX) ((float) (TYPE) (X)), (RES));  \
-         TEST_TYPE ((FUNC ## SUFFIX) ((float) (TYPE) (X)), TTYPE);     \
-       }                                                               \
-      if (sizeof (TYPE) <= 4)                                          \
-       {                                                               \
-         TEST_COMPARE (FUNC ## SUFFIX ((double) (TYPE) (X)), (RES));   \
-         TEST_TYPE (FUNC ## SUFFIX ((double) (TYPE) (X)), TTYPE);      \
-         TEST_COMPARE ((FUNC ## SUFFIX) ((double) (TYPE) (X)), (RES)); \
-         TEST_TYPE ((FUNC ## SUFFIX) ((double) (TYPE) (X)), TTYPE);    \
-         TEST_COMPARE (FUNC ## SUFFIX ((long double) (TYPE) (X)), (RES)); \
-         TEST_TYPE (FUNC ## SUFFIX ((long double) (TYPE) (X)), TTYPE); \
-         TEST_COMPARE ((FUNC ## SUFFIX) ((long double) (TYPE) (X)), (RES)); \
-         TEST_TYPE ((FUNC ## SUFFIX) ((long double) (TYPE) (X)), TTYPE); \
-       }                                                               \
-      TYPE xt = (X);                                                   \
-      TEST_COMPARE (FUNC ## SUFFIX (xt++), (RES));                     \
-      TEST_COMPARE (xt, (TYPE) ((X) + 1));                             \
-      xt = (X);                                                                \
-      TEST_COMPARE (FUNC (xt++), (RES));                               \
-      TEST_COMPARE (xt, (TYPE) ((X) + 1));                             \
-    }                                                                  \
-  while (0)
-
-#define TEST_STDBIT_UI(FUNC, INPUTS)                   \
-  do                                                   \
-    for (int i = 0; i < array_length (INPUTS); i++)    \
-      {                                                        \
-       uint64_t x = (INPUTS)[i].x;                     \
-       unsigned int res_8 = (INPUTS)[i].res_8;         \
-       unsigned int res_16 = (INPUTS)[i].res_16;       \
-       unsigned int res_32 = (INPUTS)[i].res_32;       \
-       unsigned int res_64 = (INPUTS)[i].res_64;       \
-       unsigned int res_l = (sizeof (long int) == 4    \
-                             ? res_32 : res_64);       \
-       TEST_STDBIT_T (FUNC, x, res_8, unsigned int,    \
-                      unsigned char, _uc);             \
-       TEST_STDBIT_T (FUNC, x, res_16, unsigned int,   \
-                      unsigned short, _us);            \
-       TEST_STDBIT_T (FUNC, x, res_32, unsigned int,   \
-                      unsigned int, _ui);              \
-       TEST_STDBIT_T (FUNC, x, res_l, unsigned int,    \
-                      unsigned long int, _ul);         \
-       TEST_STDBIT_T (FUNC, x, res_64, unsigned int,   \
-                      unsigned long long int, _ull);   \
-      }                                                        \
-  while (0)
-
-#define TEST_STDBIT_BOOL(FUNC, INPUTS)                                 \
-  do                                                                   \
-    for (int i = 0; i < array_length (INPUTS); i++)                    \
-      {                                                                        \
-       uint64_t x = (INPUTS)[i].x;                                     \
-       bool res_8 = (INPUTS)[i].res_8;                                 \
-       bool res_16 = (INPUTS)[i].res_16;                               \
-       bool res_32 = (INPUTS)[i].res_32;                               \
-       bool res_64 = (INPUTS)[i].res_64;                               \
-       bool res_l = (sizeof (long int) == 4 ? res_32 : res_64);        \
-       TEST_STDBIT_T (FUNC, x, res_8, _Bool, unsigned char, _uc);      \
-       TEST_STDBIT_T (FUNC, x, res_16, _Bool, unsigned short, _us);    \
-       TEST_STDBIT_T (FUNC, x, res_32, _Bool, unsigned int, _ui);      \
-       TEST_STDBIT_T (FUNC, x, res_l, _Bool, unsigned long int, _ul);  \
-       TEST_STDBIT_T (FUNC, x, res_64, _Bool,                          \
-                      unsigned long long int, _ull);                   \
-      }                                                                        \
-  while (0)
-
-#define TEST_STDBIT_SAME(FUNC, INPUTS)                         \
-  do                                                           \
-    for (int i = 0; i < array_length (INPUTS); i++)            \
-      {                                                                \
-       uint64_t x = (INPUTS)[i].x;                             \
-       unsigned char res_8 = (INPUTS)[i].res_8;                \
-       unsigned short res_16 = (INPUTS)[i].res_16;             \
-       unsigned int res_32 = (INPUTS)[i].res_32;               \
-       unsigned long long int res_64 = (INPUTS)[i].res_64;     \
-       unsigned long int res_l = (sizeof (long int) == 4       \
-                                  ? res_32 : res_64);          \
-       TEST_STDBIT_T (FUNC, x, res_8, unsigned char,           \
-                      unsigned char, _uc);                     \
-       TEST_STDBIT_T (FUNC, x, res_16, unsigned short,         \
-                      unsigned short, _us);                    \
-       TEST_STDBIT_T (FUNC, x, res_32, unsigned int,           \
-                      unsigned int, _ui);                      \
-       TEST_STDBIT_T (FUNC, x, res_l, unsigned long int,       \
-                      unsigned long int, _ul);                 \
-       TEST_STDBIT_T (FUNC, x, res_64, unsigned long long int, \
-                      unsigned long long int, _ull);           \
-      }                                                                \
-  while (0)
-
-#define TEST_STDBIT_UI_TOPLEVEL(FUNC)                          \
-  TEST_TYPE (FUNC ## _uc ((unsigned char) 0), unsigned int);   \
-  TEST_TYPE (FUNC ((unsigned char) 0), unsigned int);          \
-  TEST_TYPE (FUNC ## _us ((unsigned short) 0), unsigned int);  \
-  TEST_TYPE (FUNC ((unsigned short) 0), unsigned int);         \
-  TEST_TYPE (FUNC ## _ui (0U), unsigned int);                  \
-  TEST_TYPE (FUNC (0U), unsigned int);                         \
-  TEST_TYPE (FUNC ## _ul (0UL), unsigned int);                 \
-  TEST_TYPE (FUNC (0UL), unsigned int);                                \
-  TEST_TYPE (FUNC ## _ull (0ULL), unsigned int);               \
-  TEST_TYPE (FUNC (0ULL), unsigned int)
-
-#define TEST_STDBIT_BOOL_TOPLEVEL(FUNC)                        \
-  TEST_TYPE (FUNC ## _uc ((unsigned char) 0), _Bool);  \
-  TEST_TYPE (FUNC ((unsigned char) 0), _Bool);         \
-  TEST_TYPE (FUNC ## _us ((unsigned short) 0), _Bool); \
-  TEST_TYPE (FUNC ((unsigned short) 0), _Bool);                \
-  TEST_TYPE (FUNC ## _ui (0U), _Bool);                 \
-  TEST_TYPE (FUNC (0U), _Bool);                                \
-  TEST_TYPE (FUNC ## _ul (0UL), _Bool);                        \
-  TEST_TYPE (FUNC (0UL), _Bool);                       \
-  TEST_TYPE (FUNC ## _ull (0ULL), _Bool);              \
-  TEST_TYPE (FUNC (0ULL), _Bool)
-
-#define TEST_STDBIT_SAME_TOPLEVEL(FUNC)                                \
-  TEST_TYPE (FUNC ## _uc ((unsigned char) 0), unsigned char);  \
-  TEST_TYPE (FUNC ((unsigned char) 0), unsigned char);         \
-  TEST_TYPE (FUNC ## _us ((unsigned short) 0), unsigned short);        \
-  TEST_TYPE (FUNC ((unsigned short) 0), unsigned short);       \
-  TEST_TYPE (FUNC ## _ui (0U), unsigned int);                  \
-  TEST_TYPE (FUNC (0U), unsigned int);                         \
-  TEST_TYPE (FUNC ## _ul (0UL), unsigned long int);            \
-  TEST_TYPE (FUNC (0UL), unsigned long int);                   \
-  TEST_TYPE (FUNC ## _ull (0ULL), unsigned long long int);     \
-  TEST_TYPE (FUNC (0ULL), unsigned long long int)
-
-#endif
diff --git a/tests/tst-stdc_bit_ceil.c b/tests/tst-stdc_bit_ceil.c
deleted file mode 100644 (file)
index 9f2f327..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Test stdc_bit_ceil functions and macros.
-   Copyright (C) 2024 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <tst-stdbit.h>
-
-static const struct stdbit_test inputs[] =
-  {
-    { 0ULL, 0x1, 0x1, 0x1, 0x1ULL },
-    { 0x1ULL, 0x1, 0x1, 0x1, 0x1ULL },
-    { 0x2ULL, 0x2, 0x2, 0x2, 0x2ULL },
-    { 0x3ULL, 0x4, 0x4, 0x4, 0x4ULL },
-    { 0x4ULL, 0x4, 0x4, 0x4, 0x4ULL },
-    { 0x5ULL, 0x8, 0x8, 0x8, 0x8ULL },
-    { 0x6ULL, 0x8, 0x8, 0x8, 0x8ULL },
-    { 0x7ULL, 0x8, 0x8, 0x8, 0x8ULL },
-    { 0x8ULL, 0x8, 0x8, 0x8, 0x8ULL },
-    { 0x9ULL, 0x10, 0x10, 0x10, 0x10ULL },
-    { 0xaULL, 0x10, 0x10, 0x10, 0x10ULL },
-    { 0xbULL, 0x10, 0x10, 0x10, 0x10ULL },
-    { 0xcULL, 0x10, 0x10, 0x10, 0x10ULL },
-    { 0xdULL, 0x10, 0x10, 0x10, 0x10ULL },
-    { 0xeULL, 0x10, 0x10, 0x10, 0x10ULL },
-    { 0xfULL, 0x10, 0x10, 0x10, 0x10ULL },
-    { 0x10ULL, 0x10, 0x10, 0x10, 0x10ULL },
-    { 0x11ULL, 0x20, 0x20, 0x20, 0x20ULL },
-    { 0x12ULL, 0x20, 0x20, 0x20, 0x20ULL },
-    { 0x1fULL, 0x20, 0x20, 0x20, 0x20ULL },
-    { 0x20ULL, 0x20, 0x20, 0x20, 0x20ULL },
-    { 0x7fULL, 0x80, 0x80, 0x80, 0x80ULL },
-    { 0x80ULL, 0x80, 0x80, 0x80, 0x80ULL },
-    { 0x81ULL, 0, 0x100, 0x100, 0x100ULL },
-    { 0x9aULL, 0, 0x100, 0x100, 0x100ULL },
-    { 0xf3ULL, 0, 0x100, 0x100, 0x100ULL },
-    { 0xffULL, 0, 0x100, 0x100, 0x100ULL },
-    { 0x100ULL, 0x1, 0x100, 0x100, 0x100ULL },
-    { 0x101ULL, 0x1, 0x200, 0x200, 0x200ULL },
-    { 0x102ULL, 0x2, 0x200, 0x200, 0x200ULL },
-    { 0x1feULL, 0, 0x200, 0x200, 0x200ULL },
-    { 0x1ffULL, 0, 0x200, 0x200, 0x200ULL },
-    { 0x200ULL, 0x1, 0x200, 0x200, 0x200ULL },
-    { 0x234ULL, 0x40, 0x400, 0x400, 0x400ULL },
-    { 0x4567ULL, 0x80, 0x8000, 0x8000, 0x8000ULL },
-    { 0x7fffULL, 0, 0x8000, 0x8000, 0x8000ULL },
-    { 0x8000ULL, 0x1, 0x8000, 0x8000, 0x8000ULL },
-    { 0x8001ULL, 0x1, 0, 0x10000, 0x10000ULL },
-    { 0xfffeULL, 0, 0, 0x10000, 0x10000ULL },
-    { 0xffffULL, 0, 0, 0x10000, 0x10000ULL },
-    { 0x10000ULL, 0x1, 0x1, 0x10000, 0x10000ULL },
-    { 0x10001ULL, 0x1, 0x1, 0x20000, 0x20000ULL },
-    { 0xfedcba98ULL, 0, 0, 0, 0x100000000ULL },
-    { 0xfffffefeULL, 0, 0, 0, 0x100000000ULL },
-    { 0xffffffffULL, 0, 0, 0, 0x100000000ULL },
-    { 0x100000000ULL, 0x1, 0x1, 0x1, 0x100000000ULL },
-    { 0x100000001ULL, 0x1, 0x1, 0x1, 0x200000000ULL },
-    { 0x123456789ULL, 0, 0x8000, 0x40000000, 0x200000000ULL },
-    { 0x123456789abcdefULL, 0, 0, 0, 0x200000000000000ULL },
-    { 0x789abcdef0123456ULL, 0x80, 0x4000, 0, 0x8000000000000000ULL },
-    { 0x8000000000000000ULL, 0x1, 0x1, 0x1, 0x8000000000000000ULL },
-    { 0x8000000000000001ULL, 0x1, 0x1, 0x1, 0ULL },
-    { 0xfffffffffffffffeULL, 0, 0, 0, 0ULL },
-    { 0xffffffffffffffffULL, 0, 0, 0, 0ULL },
-  };
-
-TEST_STDBIT_SAME_TOPLEVEL (stdc_bit_ceil);
-
-static int
-do_test (void)
-{
-  TEST_STDBIT_SAME (stdc_bit_ceil, inputs);
-  return 0;
-}
-
-#include <support/test-driver.c>
diff --git a/tests/tst-stdc_bit_floor.c b/tests/tst-stdc_bit_floor.c
deleted file mode 100644 (file)
index 3f1d053..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Test stdc_bit_floor functions and macros.
-   Copyright (C) 2024 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <tst-stdbit.h>
-
-static const struct stdbit_test inputs[] =
-  {
-    { 0ULL, 0, 0, 0, 0ULL },
-    { 0x1ULL, 0x1, 0x1, 0x1, 0x1ULL },
-    { 0x2ULL, 0x2, 0x2, 0x2, 0x2ULL },
-    { 0x3ULL, 0x2, 0x2, 0x2, 0x2ULL },
-    { 0x4ULL, 0x4, 0x4, 0x4, 0x4ULL },
-    { 0x5ULL, 0x4, 0x4, 0x4, 0x4ULL },
-    { 0x6ULL, 0x4, 0x4, 0x4, 0x4ULL },
-    { 0x7ULL, 0x4, 0x4, 0x4, 0x4ULL },
-    { 0x8ULL, 0x8, 0x8, 0x8, 0x8ULL },
-    { 0x9ULL, 0x8, 0x8, 0x8, 0x8ULL },
-    { 0xaULL, 0x8, 0x8, 0x8, 0x8ULL },
-    { 0xbULL, 0x8, 0x8, 0x8, 0x8ULL },
-    { 0xcULL, 0x8, 0x8, 0x8, 0x8ULL },
-    { 0xdULL, 0x8, 0x8, 0x8, 0x8ULL },
-    { 0xeULL, 0x8, 0x8, 0x8, 0x8ULL },
-    { 0xfULL, 0x8, 0x8, 0x8, 0x8ULL },
-    { 0x10ULL, 0x10, 0x10, 0x10, 0x10ULL },
-    { 0x11ULL, 0x10, 0x10, 0x10, 0x10ULL },
-    { 0x12ULL, 0x10, 0x10, 0x10, 0x10ULL },
-    { 0x1fULL, 0x10, 0x10, 0x10, 0x10ULL },
-    { 0x20ULL, 0x20, 0x20, 0x20, 0x20ULL },
-    { 0x7fULL, 0x40, 0x40, 0x40, 0x40ULL },
-    { 0x80ULL, 0x80, 0x80, 0x80, 0x80ULL },
-    { 0x81ULL, 0x80, 0x80, 0x80, 0x80ULL },
-    { 0x9aULL, 0x80, 0x80, 0x80, 0x80ULL },
-    { 0xf3ULL, 0x80, 0x80, 0x80, 0x80ULL },
-    { 0xffULL, 0x80, 0x80, 0x80, 0x80ULL },
-    { 0x100ULL, 0, 0x100, 0x100, 0x100ULL },
-    { 0x101ULL, 0x1, 0x100, 0x100, 0x100ULL },
-    { 0x102ULL, 0x2, 0x100, 0x100, 0x100ULL },
-    { 0x1feULL, 0x80, 0x100, 0x100, 0x100ULL },
-    { 0x1ffULL, 0x80, 0x100, 0x100, 0x100ULL },
-    { 0x200ULL, 0, 0x200, 0x200, 0x200ULL },
-    { 0x234ULL, 0x20, 0x200, 0x200, 0x200ULL },
-    { 0x4567ULL, 0x40, 0x4000, 0x4000, 0x4000ULL },
-    { 0x7fffULL, 0x80, 0x4000, 0x4000, 0x4000ULL },
-    { 0x8000ULL, 0, 0x8000, 0x8000, 0x8000ULL },
-    { 0x8001ULL, 0x1, 0x8000, 0x8000, 0x8000ULL },
-    { 0xfffeULL, 0x80, 0x8000, 0x8000, 0x8000ULL },
-    { 0xffffULL, 0x80, 0x8000, 0x8000, 0x8000ULL },
-    { 0x10000ULL, 0, 0, 0x10000, 0x10000ULL },
-    { 0x10001ULL, 0x1, 0x1, 0x10000, 0x10000ULL },
-    { 0xfedcba98ULL, 0x80, 0x8000, 0x80000000, 0x80000000ULL },
-    { 0xfffffefeULL, 0x80, 0x8000, 0x80000000, 0x80000000ULL },
-    { 0xffffffffULL, 0x80, 0x8000, 0x80000000, 0x80000000ULL },
-    { 0x100000000ULL, 0, 0, 0, 0x100000000ULL },
-    { 0x100000001ULL, 0x1, 0x1, 0x1, 0x100000000ULL },
-    { 0x123456789ULL, 0x80, 0x4000, 0x20000000, 0x100000000ULL },
-    { 0x123456789abcdefULL, 0x80, 0x8000, 0x80000000, 0x100000000000000ULL },
-    { 0x789abcdef0123456ULL, 0x40, 0x2000, 0x80000000, 0x4000000000000000ULL },
-    { 0x8000000000000000ULL, 0, 0, 0, 0x8000000000000000ULL },
-    { 0x8000000000000001ULL, 0x1, 0x1, 0x1, 0x8000000000000000ULL },
-    { 0xfffffffffffffffeULL, 0x80, 0x8000, 0x80000000, 0x8000000000000000ULL },
-    { 0xffffffffffffffffULL, 0x80, 0x8000, 0x80000000, 0x8000000000000000ULL },
-  };
-
-TEST_STDBIT_SAME_TOPLEVEL (stdc_bit_floor);
-
-static int
-do_test (void)
-{
-  TEST_STDBIT_SAME (stdc_bit_floor, inputs);
-  return 0;
-}
-
-#include <support/test-driver.c>
diff --git a/tests/tst-stdc_bit_width.c b/tests/tst-stdc_bit_width.c
deleted file mode 100644 (file)
index b3bb6f6..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Test stdc_bit_width functions and macros.
-   Copyright (C) 2024 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <tst-stdbit.h>
-
-static const struct stdbit_test inputs[] =
-  {
-    { 0ULL, 0, 0, 0, 0 },
-    { 0x1ULL, 1, 1, 1, 1 },
-    { 0x2ULL, 2, 2, 2, 2 },
-    { 0x3ULL, 2, 2, 2, 2 },
-    { 0x4ULL, 3, 3, 3, 3 },
-    { 0x5ULL, 3, 3, 3, 3 },
-    { 0x6ULL, 3, 3, 3, 3 },
-    { 0x7ULL, 3, 3, 3, 3 },
-    { 0x8ULL, 4, 4, 4, 4 },
-    { 0x9ULL, 4, 4, 4, 4 },
-    { 0xaULL, 4, 4, 4, 4 },
-    { 0xbULL, 4, 4, 4, 4 },
-    { 0xcULL, 4, 4, 4, 4 },
-    { 0xdULL, 4, 4, 4, 4 },
-    { 0xeULL, 4, 4, 4, 4 },
-    { 0xfULL, 4, 4, 4, 4 },
-    { 0x10ULL, 5, 5, 5, 5 },
-    { 0x11ULL, 5, 5, 5, 5 },
-    { 0x12ULL, 5, 5, 5, 5 },
-    { 0x1fULL, 5, 5, 5, 5 },
-    { 0x20ULL, 6, 6, 6, 6 },
-    { 0x7fULL, 7, 7, 7, 7 },
-    { 0x80ULL, 8, 8, 8, 8 },
-    { 0x81ULL, 8, 8, 8, 8 },
-    { 0x9aULL, 8, 8, 8, 8 },
-    { 0xf3ULL, 8, 8, 8, 8 },
-    { 0xffULL, 8, 8, 8, 8 },
-    { 0x100ULL, 0, 9, 9, 9 },
-    { 0x101ULL, 1, 9, 9, 9 },
-    { 0x102ULL, 2, 9, 9, 9 },
-    { 0x1feULL, 8, 9, 9, 9 },
-    { 0x1ffULL, 8, 9, 9, 9 },
-    { 0x200ULL, 0, 10, 10, 10 },
-    { 0x234ULL, 6, 10, 10, 10 },
-    { 0x4567ULL, 7, 15, 15, 15 },
-    { 0x7fffULL, 8, 15, 15, 15 },
-    { 0x8000ULL, 0, 16, 16, 16 },
-    { 0x8001ULL, 1, 16, 16, 16 },
-    { 0xfffeULL, 8, 16, 16, 16 },
-    { 0xffffULL, 8, 16, 16, 16 },
-    { 0x10000ULL, 0, 0, 17, 17 },
-    { 0x10001ULL, 1, 1, 17, 17 },
-    { 0xfedcba98ULL, 8, 16, 32, 32 },
-    { 0xfffffefeULL, 8, 16, 32, 32 },
-    { 0xffffffffULL, 8, 16, 32, 32 },
-    { 0x100000000ULL, 0, 0, 0, 33 },
-    { 0x100000001ULL, 1, 1, 1, 33 },
-    { 0x123456789ULL, 8, 15, 30, 33 },
-    { 0x123456789abcdefULL, 8, 16, 32, 57 },
-    { 0x789abcdef0123456ULL, 7, 14, 32, 63 },
-    { 0x8000000000000000ULL, 0, 0, 0, 64 },
-    { 0x8000000000000001ULL, 1, 1, 1, 64 },
-    { 0xfffffffffffffffeULL, 8, 16, 32, 64 },
-    { 0xffffffffffffffffULL, 8, 16, 32, 64 },
-  };
-
-TEST_STDBIT_UI_TOPLEVEL (stdc_bit_width);
-
-static int
-do_test (void)
-{
-  TEST_STDBIT_UI (stdc_bit_width, inputs);
-  return 0;
-}
-
-#include <support/test-driver.c>
diff --git a/tests/tst-stdc_count_ones.c b/tests/tst-stdc_count_ones.c
deleted file mode 100644 (file)
index 8f8e3a7..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Test stdc_count_ones functions and macros.
-   Copyright (C) 2024 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <tst-stdbit.h>
-
-static const struct stdbit_test inputs[] =
-  {
-    { 0ULL, 0, 0, 0, 0 },
-    { 0x1ULL, 1, 1, 1, 1 },
-    { 0x2ULL, 1, 1, 1, 1 },
-    { 0x3ULL, 2, 2, 2, 2 },
-    { 0x4ULL, 1, 1, 1, 1 },
-    { 0x5ULL, 2, 2, 2, 2 },
-    { 0x6ULL, 2, 2, 2, 2 },
-    { 0x7ULL, 3, 3, 3, 3 },
-    { 0x8ULL, 1, 1, 1, 1 },
-    { 0x9ULL, 2, 2, 2, 2 },
-    { 0xaULL, 2, 2, 2, 2 },
-    { 0xbULL, 3, 3, 3, 3 },
-    { 0xcULL, 2, 2, 2, 2 },
-    { 0xdULL, 3, 3, 3, 3 },
-    { 0xeULL, 3, 3, 3, 3 },
-    { 0xfULL, 4, 4, 4, 4 },
-    { 0x10ULL, 1, 1, 1, 1 },
-    { 0x11ULL, 2, 2, 2, 2 },
-    { 0x12ULL, 2, 2, 2, 2 },
-    { 0x1fULL, 5, 5, 5, 5 },
-    { 0x20ULL, 1, 1, 1, 1 },
-    { 0x7fULL, 7, 7, 7, 7 },
-    { 0x80ULL, 1, 1, 1, 1 },
-    { 0x81ULL, 2, 2, 2, 2 },
-    { 0x9aULL, 4, 4, 4, 4 },
-    { 0xf3ULL, 6, 6, 6, 6 },
-    { 0xffULL, 8, 8, 8, 8 },
-    { 0x100ULL, 0, 1, 1, 1 },
-    { 0x101ULL, 1, 2, 2, 2 },
-    { 0x102ULL, 1, 2, 2, 2 },
-    { 0x1feULL, 7, 8, 8, 8 },
-    { 0x1ffULL, 8, 9, 9, 9 },
-    { 0x200ULL, 0, 1, 1, 1 },
-    { 0x234ULL, 3, 4, 4, 4 },
-    { 0x4567ULL, 5, 8, 8, 8 },
-    { 0x7fffULL, 8, 15, 15, 15 },
-    { 0x8000ULL, 0, 1, 1, 1 },
-    { 0x8001ULL, 1, 2, 2, 2 },
-    { 0xfffeULL, 7, 15, 15, 15 },
-    { 0xffffULL, 8, 16, 16, 16 },
-    { 0x10000ULL, 0, 0, 1, 1 },
-    { 0x10001ULL, 1, 1, 2, 2 },
-    { 0xfedcba98ULL, 3, 8, 20, 20 },
-    { 0xfffffefeULL, 7, 14, 30, 30 },
-    { 0xffffffffULL, 8, 16, 32, 32 },
-    { 0x100000000ULL, 0, 0, 0, 1 },
-    { 0x100000001ULL, 1, 1, 1, 2 },
-    { 0x123456789ULL, 3, 8, 14, 15 },
-    { 0x123456789abcdefULL, 7, 12, 20, 32 },
-    { 0x789abcdef0123456ULL, 4, 7, 13, 32 },
-    { 0x8000000000000000ULL, 0, 0, 0, 1 },
-    { 0x8000000000000001ULL, 1, 1, 1, 2 },
-    { 0xfffffffffffffffeULL, 7, 15, 31, 63 },
-    { 0xffffffffffffffffULL, 8, 16, 32, 64 },
-  };
-
-TEST_STDBIT_UI_TOPLEVEL (stdc_count_ones);
-
-static int
-do_test (void)
-{
-  TEST_STDBIT_UI (stdc_count_ones, inputs);
-  return 0;
-}
-
-#include <support/test-driver.c>
diff --git a/tests/tst-stdc_count_zeros.c b/tests/tst-stdc_count_zeros.c
deleted file mode 100644 (file)
index cb72c83..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Test stdc_count_zeros functions and macros.
-   Copyright (C) 2024 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <tst-stdbit.h>
-
-static const struct stdbit_test inputs[] =
-  {
-    { 0ULL, 8, 16, 32, 64 },
-    { 0x1ULL, 7, 15, 31, 63 },
-    { 0x2ULL, 7, 15, 31, 63 },
-    { 0x3ULL, 6, 14, 30, 62 },
-    { 0x4ULL, 7, 15, 31, 63 },
-    { 0x5ULL, 6, 14, 30, 62 },
-    { 0x6ULL, 6, 14, 30, 62 },
-    { 0x7ULL, 5, 13, 29, 61 },
-    { 0x8ULL, 7, 15, 31, 63 },
-    { 0x9ULL, 6, 14, 30, 62 },
-    { 0xaULL, 6, 14, 30, 62 },
-    { 0xbULL, 5, 13, 29, 61 },
-    { 0xcULL, 6, 14, 30, 62 },
-    { 0xdULL, 5, 13, 29, 61 },
-    { 0xeULL, 5, 13, 29, 61 },
-    { 0xfULL, 4, 12, 28, 60 },
-    { 0x10ULL, 7, 15, 31, 63 },
-    { 0x11ULL, 6, 14, 30, 62 },
-    { 0x12ULL, 6, 14, 30, 62 },
-    { 0x1fULL, 3, 11, 27, 59 },
-    { 0x20ULL, 7, 15, 31, 63 },
-    { 0x7fULL, 1, 9, 25, 57 },
-    { 0x80ULL, 7, 15, 31, 63 },
-    { 0x81ULL, 6, 14, 30, 62 },
-    { 0x9aULL, 4, 12, 28, 60 },
-    { 0xf3ULL, 2, 10, 26, 58 },
-    { 0xffULL, 0, 8, 24, 56 },
-    { 0x100ULL, 8, 15, 31, 63 },
-    { 0x101ULL, 7, 14, 30, 62 },
-    { 0x102ULL, 7, 14, 30, 62 },
-    { 0x1feULL, 1, 8, 24, 56 },
-    { 0x1ffULL, 0, 7, 23, 55 },
-    { 0x200ULL, 8, 15, 31, 63 },
-    { 0x234ULL, 5, 12, 28, 60 },
-    { 0x4567ULL, 3, 8, 24, 56 },
-    { 0x7fffULL, 0, 1, 17, 49 },
-    { 0x8000ULL, 8, 15, 31, 63 },
-    { 0x8001ULL, 7, 14, 30, 62 },
-    { 0xfffeULL, 1, 1, 17, 49 },
-    { 0xffffULL, 0, 0, 16, 48 },
-    { 0x10000ULL, 8, 16, 31, 63 },
-    { 0x10001ULL, 7, 15, 30, 62 },
-    { 0xfedcba98ULL, 5, 8, 12, 44 },
-    { 0xfffffefeULL, 1, 2, 2, 34 },
-    { 0xffffffffULL, 0, 0, 0, 32 },
-    { 0x100000000ULL, 8, 16, 32, 63 },
-    { 0x100000001ULL, 7, 15, 31, 62 },
-    { 0x123456789ULL, 5, 8, 18, 49 },
-    { 0x123456789abcdefULL, 1, 4, 12, 32 },
-    { 0x789abcdef0123456ULL, 4, 9, 19, 32 },
-    { 0x8000000000000000ULL, 8, 16, 32, 63 },
-    { 0x8000000000000001ULL, 7, 15, 31, 62 },
-    { 0xfffffffffffffffeULL, 1, 1, 1, 1 },
-    { 0xffffffffffffffffULL, 0, 0, 0, 0 },
-  };
-
-TEST_STDBIT_UI_TOPLEVEL (stdc_count_zeros);
-
-static int
-do_test (void)
-{
-  TEST_STDBIT_UI (stdc_count_zeros, inputs);
-  return 0;
-}
-
-#include <support/test-driver.c>
diff --git a/tests/tst-stdc_first_leading_one.c b/tests/tst-stdc_first_leading_one.c
deleted file mode 100644 (file)
index 63f24bd..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Test stdc_first_leading_one functions and macros.
-   Copyright (C) 2024 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <tst-stdbit.h>
-
-static const struct stdbit_test inputs[] =
-  {
-    { 0ULL, 0, 0, 0, 0 },
-    { 0x1ULL, 8, 16, 32, 64 },
-    { 0x2ULL, 7, 15, 31, 63 },
-    { 0x3ULL, 7, 15, 31, 63 },
-    { 0x4ULL, 6, 14, 30, 62 },
-    { 0x5ULL, 6, 14, 30, 62 },
-    { 0x6ULL, 6, 14, 30, 62 },
-    { 0x7ULL, 6, 14, 30, 62 },
-    { 0x8ULL, 5, 13, 29, 61 },
-    { 0x9ULL, 5, 13, 29, 61 },
-    { 0xaULL, 5, 13, 29, 61 },
-    { 0xbULL, 5, 13, 29, 61 },
-    { 0xcULL, 5, 13, 29, 61 },
-    { 0xdULL, 5, 13, 29, 61 },
-    { 0xeULL, 5, 13, 29, 61 },
-    { 0xfULL, 5, 13, 29, 61 },
-    { 0x10ULL, 4, 12, 28, 60 },
-    { 0x11ULL, 4, 12, 28, 60 },
-    { 0x12ULL, 4, 12, 28, 60 },
-    { 0x1fULL, 4, 12, 28, 60 },
-    { 0x20ULL, 3, 11, 27, 59 },
-    { 0x7fULL, 2, 10, 26, 58 },
-    { 0x80ULL, 1, 9, 25, 57 },
-    { 0x81ULL, 1, 9, 25, 57 },
-    { 0x9aULL, 1, 9, 25, 57 },
-    { 0xf3ULL, 1, 9, 25, 57 },
-    { 0xffULL, 1, 9, 25, 57 },
-    { 0x100ULL, 0, 8, 24, 56 },
-    { 0x101ULL, 8, 8, 24, 56 },
-    { 0x102ULL, 7, 8, 24, 56 },
-    { 0x1feULL, 1, 8, 24, 56 },
-    { 0x1ffULL, 1, 8, 24, 56 },
-    { 0x200ULL, 0, 7, 23, 55 },
-    { 0x234ULL, 3, 7, 23, 55 },
-    { 0x4567ULL, 2, 2, 18, 50 },
-    { 0x7fffULL, 1, 2, 18, 50 },
-    { 0x8000ULL, 0, 1, 17, 49 },
-    { 0x8001ULL, 8, 1, 17, 49 },
-    { 0xfffeULL, 1, 1, 17, 49 },
-    { 0xffffULL, 1, 1, 17, 49 },
-    { 0x10000ULL, 0, 0, 16, 48 },
-    { 0x10001ULL, 8, 16, 16, 48 },
-    { 0xfedcba98ULL, 1, 1, 1, 33 },
-    { 0xfffffefeULL, 1, 1, 1, 33 },
-    { 0xffffffffULL, 1, 1, 1, 33 },
-    { 0x100000000ULL, 0, 0, 0, 32 },
-    { 0x100000001ULL, 8, 16, 32, 32 },
-    { 0x123456789ULL, 1, 2, 3, 32 },
-    { 0x123456789abcdefULL, 1, 1, 1, 8 },
-    { 0x789abcdef0123456ULL, 2, 3, 1, 2 },
-    { 0x8000000000000000ULL, 0, 0, 0, 1 },
-    { 0x8000000000000001ULL, 8, 16, 32, 1 },
-    { 0xfffffffffffffffeULL, 1, 1, 1, 1 },
-    { 0xffffffffffffffffULL, 1, 1, 1, 1 },
-  };
-
-TEST_STDBIT_UI_TOPLEVEL (stdc_first_leading_one);
-
-static int
-do_test (void)
-{
-  TEST_STDBIT_UI (stdc_first_leading_one, inputs);
-  return 0;
-}
-
-#include <support/test-driver.c>
diff --git a/tests/tst-stdc_first_leading_zero.c b/tests/tst-stdc_first_leading_zero.c
deleted file mode 100644 (file)
index b9d1167..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Test stdc_first_leading_zero functions and macros.
-   Copyright (C) 2024 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <tst-stdbit.h>
-
-static const struct stdbit_test inputs[] =
-  {
-    { 0ULL, 1, 1, 1, 1 },
-    { 0x1ULL, 1, 1, 1, 1 },
-    { 0x2ULL, 1, 1, 1, 1 },
-    { 0x3ULL, 1, 1, 1, 1 },
-    { 0x4ULL, 1, 1, 1, 1 },
-    { 0x5ULL, 1, 1, 1, 1 },
-    { 0x6ULL, 1, 1, 1, 1 },
-    { 0x7ULL, 1, 1, 1, 1 },
-    { 0x8ULL, 1, 1, 1, 1 },
-    { 0x9ULL, 1, 1, 1, 1 },
-    { 0xaULL, 1, 1, 1, 1 },
-    { 0xbULL, 1, 1, 1, 1 },
-    { 0xcULL, 1, 1, 1, 1 },
-    { 0xdULL, 1, 1, 1, 1 },
-    { 0xeULL, 1, 1, 1, 1 },
-    { 0xfULL, 1, 1, 1, 1 },
-    { 0x10ULL, 1, 1, 1, 1 },
-    { 0x11ULL, 1, 1, 1, 1 },
-    { 0x12ULL, 1, 1, 1, 1 },
-    { 0x1fULL, 1, 1, 1, 1 },
-    { 0x20ULL, 1, 1, 1, 1 },
-    { 0x7fULL, 1, 1, 1, 1 },
-    { 0x80ULL, 2, 1, 1, 1 },
-    { 0x81ULL, 2, 1, 1, 1 },
-    { 0x9aULL, 2, 1, 1, 1 },
-    { 0xf3ULL, 5, 1, 1, 1 },
-    { 0xffULL, 0, 1, 1, 1 },
-    { 0x100ULL, 1, 1, 1, 1 },
-    { 0x101ULL, 1, 1, 1, 1 },
-    { 0x102ULL, 1, 1, 1, 1 },
-    { 0x1feULL, 8, 1, 1, 1 },
-    { 0x1ffULL, 0, 1, 1, 1 },
-    { 0x200ULL, 1, 1, 1, 1 },
-    { 0x234ULL, 1, 1, 1, 1 },
-    { 0x4567ULL, 1, 1, 1, 1 },
-    { 0x7fffULL, 0, 1, 1, 1 },
-    { 0x8000ULL, 1, 2, 1, 1 },
-    { 0x8001ULL, 1, 2, 1, 1 },
-    { 0xfffeULL, 8, 16, 1, 1 },
-    { 0xffffULL, 0, 0, 1, 1 },
-    { 0x10000ULL, 1, 1, 1, 1 },
-    { 0x10001ULL, 1, 1, 1, 1 },
-    { 0xfedcba98ULL, 2, 2, 8, 1 },
-    { 0xfffffefeULL, 8, 8, 24, 1 },
-    { 0xffffffffULL, 0, 0, 0, 1 },
-    { 0x100000000ULL, 1, 1, 1, 1 },
-    { 0x100000001ULL, 1, 1, 1, 1 },
-    { 0x123456789ULL, 2, 1, 1, 1 },
-    { 0x123456789abcdefULL, 4, 3, 2, 1 },
-    { 0x789abcdef0123456ULL, 1, 1, 5, 1 },
-    { 0x8000000000000000ULL, 1, 1, 1, 2 },
-    { 0x8000000000000001ULL, 1, 1, 1, 2 },
-    { 0xfffffffffffffffeULL, 8, 16, 32, 64 },
-    { 0xffffffffffffffffULL, 0, 0, 0, 0 },
-  };
-
-TEST_STDBIT_UI_TOPLEVEL (stdc_first_leading_zero);
-
-static int
-do_test (void)
-{
-  TEST_STDBIT_UI (stdc_first_leading_zero, inputs);
-  return 0;
-}
-
-#include <support/test-driver.c>
diff --git a/tests/tst-stdc_first_trailing_one.c b/tests/tst-stdc_first_trailing_one.c
deleted file mode 100644 (file)
index d4eeb22..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Test stdc_first_trailing_one functions and macros.
-   Copyright (C) 2024 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <tst-stdbit.h>
-
-static const struct stdbit_test inputs[] =
-  {
-    { 0ULL, 0, 0, 0, 0 },
-    { 0x1ULL, 1, 1, 1, 1 },
-    { 0x2ULL, 2, 2, 2, 2 },
-    { 0x3ULL, 1, 1, 1, 1 },
-    { 0x4ULL, 3, 3, 3, 3 },
-    { 0x5ULL, 1, 1, 1, 1 },
-    { 0x6ULL, 2, 2, 2, 2 },
-    { 0x7ULL, 1, 1, 1, 1 },
-    { 0x8ULL, 4, 4, 4, 4 },
-    { 0x9ULL, 1, 1, 1, 1 },
-    { 0xaULL, 2, 2, 2, 2 },
-    { 0xbULL, 1, 1, 1, 1 },
-    { 0xcULL, 3, 3, 3, 3 },
-    { 0xdULL, 1, 1, 1, 1 },
-    { 0xeULL, 2, 2, 2, 2 },
-    { 0xfULL, 1, 1, 1, 1 },
-    { 0x10ULL, 5, 5, 5, 5 },
-    { 0x11ULL, 1, 1, 1, 1 },
-    { 0x12ULL, 2, 2, 2, 2 },
-    { 0x1fULL, 1, 1, 1, 1 },
-    { 0x20ULL, 6, 6, 6, 6 },
-    { 0x7fULL, 1, 1, 1, 1 },
-    { 0x80ULL, 8, 8, 8, 8 },
-    { 0x81ULL, 1, 1, 1, 1 },
-    { 0x9aULL, 2, 2, 2, 2 },
-    { 0xf3ULL, 1, 1, 1, 1 },
-    { 0xffULL, 1, 1, 1, 1 },
-    { 0x100ULL, 0, 9, 9, 9 },
-    { 0x101ULL, 1, 1, 1, 1 },
-    { 0x102ULL, 2, 2, 2, 2 },
-    { 0x1feULL, 2, 2, 2, 2 },
-    { 0x1ffULL, 1, 1, 1, 1 },
-    { 0x200ULL, 0, 10, 10, 10 },
-    { 0x234ULL, 3, 3, 3, 3 },
-    { 0x4567ULL, 1, 1, 1, 1 },
-    { 0x7fffULL, 1, 1, 1, 1 },
-    { 0x8000ULL, 0, 16, 16, 16 },
-    { 0x8001ULL, 1, 1, 1, 1 },
-    { 0xfffeULL, 2, 2, 2, 2 },
-    { 0xffffULL, 1, 1, 1, 1 },
-    { 0x10000ULL, 0, 0, 17, 17 },
-    { 0x10001ULL, 1, 1, 1, 1 },
-    { 0xfedcba98ULL, 4, 4, 4, 4 },
-    { 0xfffffefeULL, 2, 2, 2, 2 },
-    { 0xffffffffULL, 1, 1, 1, 1 },
-    { 0x100000000ULL, 0, 0, 0, 33 },
-    { 0x100000001ULL, 1, 1, 1, 1 },
-    { 0x123456789ULL, 1, 1, 1, 1 },
-    { 0x123456789abcdefULL, 1, 1, 1, 1 },
-    { 0x789abcdef0123456ULL, 2, 2, 2, 2 },
-    { 0x8000000000000000ULL, 0, 0, 0, 64 },
-    { 0x8000000000000001ULL, 1, 1, 1, 1 },
-    { 0xfffffffffffffffeULL, 2, 2, 2, 2 },
-    { 0xffffffffffffffffULL, 1, 1, 1, 1 },
-  };
-
-TEST_STDBIT_UI_TOPLEVEL (stdc_first_trailing_one);
-
-static int
-do_test (void)
-{
-  TEST_STDBIT_UI (stdc_first_trailing_one, inputs);
-  return 0;
-}
-
-#include <support/test-driver.c>
diff --git a/tests/tst-stdc_first_trailing_zero.c b/tests/tst-stdc_first_trailing_zero.c
deleted file mode 100644 (file)
index 4a804e2..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Test stdc_first_trailing_zero functions and macros.
-   Copyright (C) 2024 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <tst-stdbit.h>
-
-static const struct stdbit_test inputs[] =
-  {
-    { 0ULL, 1, 1, 1, 1 },
-    { 0x1ULL, 2, 2, 2, 2 },
-    { 0x2ULL, 1, 1, 1, 1 },
-    { 0x3ULL, 3, 3, 3, 3 },
-    { 0x4ULL, 1, 1, 1, 1 },
-    { 0x5ULL, 2, 2, 2, 2 },
-    { 0x6ULL, 1, 1, 1, 1 },
-    { 0x7ULL, 4, 4, 4, 4 },
-    { 0x8ULL, 1, 1, 1, 1 },
-    { 0x9ULL, 2, 2, 2, 2 },
-    { 0xaULL, 1, 1, 1, 1 },
-    { 0xbULL, 3, 3, 3, 3 },
-    { 0xcULL, 1, 1, 1, 1 },
-    { 0xdULL, 2, 2, 2, 2 },
-    { 0xeULL, 1, 1, 1, 1 },
-    { 0xfULL, 5, 5, 5, 5 },
-    { 0x10ULL, 1, 1, 1, 1 },
-    { 0x11ULL, 2, 2, 2, 2 },
-    { 0x12ULL, 1, 1, 1, 1 },
-    { 0x1fULL, 6, 6, 6, 6 },
-    { 0x20ULL, 1, 1, 1, 1 },
-    { 0x7fULL, 8, 8, 8, 8 },
-    { 0x80ULL, 1, 1, 1, 1 },
-    { 0x81ULL, 2, 2, 2, 2 },
-    { 0x9aULL, 1, 1, 1, 1 },
-    { 0xf3ULL, 3, 3, 3, 3 },
-    { 0xffULL, 0, 9, 9, 9 },
-    { 0x100ULL, 1, 1, 1, 1 },
-    { 0x101ULL, 2, 2, 2, 2 },
-    { 0x102ULL, 1, 1, 1, 1 },
-    { 0x1feULL, 1, 1, 1, 1 },
-    { 0x1ffULL, 0, 10, 10, 10 },
-    { 0x200ULL, 1, 1, 1, 1 },
-    { 0x234ULL, 1, 1, 1, 1 },
-    { 0x4567ULL, 4, 4, 4, 4 },
-    { 0x7fffULL, 0, 16, 16, 16 },
-    { 0x8000ULL, 1, 1, 1, 1 },
-    { 0x8001ULL, 2, 2, 2, 2 },
-    { 0xfffeULL, 1, 1, 1, 1 },
-    { 0xffffULL, 0, 0, 17, 17 },
-    { 0x10000ULL, 1, 1, 1, 1 },
-    { 0x10001ULL, 2, 2, 2, 2 },
-    { 0xfedcba98ULL, 1, 1, 1, 1 },
-    { 0xfffffefeULL, 1, 1, 1, 1 },
-    { 0xffffffffULL, 0, 0, 0, 33 },
-    { 0x100000000ULL, 1, 1, 1, 1 },
-    { 0x100000001ULL, 2, 2, 2, 2 },
-    { 0x123456789ULL, 2, 2, 2, 2 },
-    { 0x123456789abcdefULL, 5, 5, 5, 5 },
-    { 0x789abcdef0123456ULL, 1, 1, 1, 1 },
-    { 0x8000000000000000ULL, 1, 1, 1, 1 },
-    { 0x8000000000000001ULL, 2, 2, 2, 2 },
-    { 0xfffffffffffffffeULL, 1, 1, 1, 1 },
-    { 0xffffffffffffffffULL, 0, 0, 0, 0 },
-  };
-
-TEST_STDBIT_UI_TOPLEVEL (stdc_first_trailing_zero);
-
-static int
-do_test (void)
-{
-  TEST_STDBIT_UI (stdc_first_trailing_zero, inputs);
-  return 0;
-}
-
-#include <support/test-driver.c>
diff --git a/tests/tst-stdc_has_single_bit.c b/tests/tst-stdc_has_single_bit.c
deleted file mode 100644 (file)
index 2a2c855..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Test stdc_has_single_bit functions and macros.
-   Copyright (C) 2024 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <tst-stdbit.h>
-
-static const struct stdbit_test inputs[] =
-  {
-    { 0ULL, false, false, false, false },
-    { 0x1ULL, true, true, true, true },
-    { 0x2ULL, true, true, true, true },
-    { 0x3ULL, false, false, false, false },
-    { 0x4ULL, true, true, true, true },
-    { 0x5ULL, false, false, false, false },
-    { 0x6ULL, false, false, false, false },
-    { 0x7ULL, false, false, false, false },
-    { 0x8ULL, true, true, true, true },
-    { 0x9ULL, false, false, false, false },
-    { 0xaULL, false, false, false, false },
-    { 0xbULL, false, false, false, false },
-    { 0xcULL, false, false, false, false },
-    { 0xdULL, false, false, false, false },
-    { 0xeULL, false, false, false, false },
-    { 0xfULL, false, false, false, false },
-    { 0x10ULL, true, true, true, true },
-    { 0x11ULL, false, false, false, false },
-    { 0x12ULL, false, false, false, false },
-    { 0x1fULL, false, false, false, false },
-    { 0x20ULL, true, true, true, true },
-    { 0x7fULL, false, false, false, false },
-    { 0x80ULL, true, true, true, true },
-    { 0x81ULL, false, false, false, false },
-    { 0x9aULL, false, false, false, false },
-    { 0xf3ULL, false, false, false, false },
-    { 0xffULL, false, false, false, false },
-    { 0x100ULL, false, true, true, true },
-    { 0x101ULL, true, false, false, false },
-    { 0x102ULL, true, false, false, false },
-    { 0x1feULL, false, false, false, false },
-    { 0x1ffULL, false, false, false, false },
-    { 0x200ULL, false, true, true, true },
-    { 0x234ULL, false, false, false, false },
-    { 0x4567ULL, false, false, false, false },
-    { 0x7fffULL, false, false, false, false },
-    { 0x8000ULL, false, true, true, true },
-    { 0x8001ULL, true, false, false, false },
-    { 0xfffeULL, false, false, false, false },
-    { 0xffffULL, false, false, false, false },
-    { 0x10000ULL, false, false, true, true },
-    { 0x10001ULL, true, true, false, false },
-    { 0xfedcba98ULL, false, false, false, false },
-    { 0xfffffefeULL, false, false, false, false },
-    { 0xffffffffULL, false, false, false, false },
-    { 0x100000000ULL, false, false, false, true },
-    { 0x100000001ULL, true, true, true, false },
-    { 0x123456789ULL, false, false, false, false },
-    { 0x123456789abcdefULL, false, false, false, false },
-    { 0x789abcdef0123456ULL, false, false, false, false },
-    { 0x8000000000000000ULL, false, false, false, true },
-    { 0x8000000000000001ULL, true, true, true, false },
-    { 0xfffffffffffffffeULL, false, false, false, false },
-    { 0xffffffffffffffffULL, false, false, false, false },
-  };
-
-TEST_STDBIT_BOOL_TOPLEVEL (stdc_has_single_bit);
-
-static int
-do_test (void)
-{
-  TEST_STDBIT_BOOL (stdc_has_single_bit, inputs);
-  return 0;
-}
-
-#include <support/test-driver.c>
diff --git a/tests/tst-stdc_leading_ones.c b/tests/tst-stdc_leading_ones.c
deleted file mode 100644 (file)
index 8d8ccd5..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Test stdc_leading_ones functions and macros.
-   Copyright (C) 2024 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <tst-stdbit.h>
-
-static const struct stdbit_test inputs[] =
-  {
-    { 0ULL, 0, 0, 0, 0 },
-    { 0x1ULL, 0, 0, 0, 0 },
-    { 0x2ULL, 0, 0, 0, 0 },
-    { 0x3ULL, 0, 0, 0, 0 },
-    { 0x4ULL, 0, 0, 0, 0 },
-    { 0x5ULL, 0, 0, 0, 0 },
-    { 0x6ULL, 0, 0, 0, 0 },
-    { 0x7ULL, 0, 0, 0, 0 },
-    { 0x8ULL, 0, 0, 0, 0 },
-    { 0x9ULL, 0, 0, 0, 0 },
-    { 0xaULL, 0, 0, 0, 0 },
-    { 0xbULL, 0, 0, 0, 0 },
-    { 0xcULL, 0, 0, 0, 0 },
-    { 0xdULL, 0, 0, 0, 0 },
-    { 0xeULL, 0, 0, 0, 0 },
-    { 0xfULL, 0, 0, 0, 0 },
-    { 0x10ULL, 0, 0, 0, 0 },
-    { 0x11ULL, 0, 0, 0, 0 },
-    { 0x12ULL, 0, 0, 0, 0 },
-    { 0x1fULL, 0, 0, 0, 0 },
-    { 0x20ULL, 0, 0, 0, 0 },
-    { 0x7fULL, 0, 0, 0, 0 },
-    { 0x80ULL, 1, 0, 0, 0 },
-    { 0x81ULL, 1, 0, 0, 0 },
-    { 0x9aULL, 1, 0, 0, 0 },
-    { 0xf3ULL, 4, 0, 0, 0 },
-    { 0xffULL, 8, 0, 0, 0 },
-    { 0x100ULL, 0, 0, 0, 0 },
-    { 0x101ULL, 0, 0, 0, 0 },
-    { 0x102ULL, 0, 0, 0, 0 },
-    { 0x1feULL, 7, 0, 0, 0 },
-    { 0x1ffULL, 8, 0, 0, 0 },
-    { 0x200ULL, 0, 0, 0, 0 },
-    { 0x234ULL, 0, 0, 0, 0 },
-    { 0x4567ULL, 0, 0, 0, 0 },
-    { 0x7fffULL, 8, 0, 0, 0 },
-    { 0x8000ULL, 0, 1, 0, 0 },
-    { 0x8001ULL, 0, 1, 0, 0 },
-    { 0xfffeULL, 7, 15, 0, 0 },
-    { 0xffffULL, 8, 16, 0, 0 },
-    { 0x10000ULL, 0, 0, 0, 0 },
-    { 0x10001ULL, 0, 0, 0, 0 },
-    { 0xfedcba98ULL, 1, 1, 7, 0 },
-    { 0xfffffefeULL, 7, 7, 23, 0 },
-    { 0xffffffffULL, 8, 16, 32, 0 },
-    { 0x100000000ULL, 0, 0, 0, 0 },
-    { 0x100000001ULL, 0, 0, 0, 0 },
-    { 0x123456789ULL, 1, 0, 0, 0 },
-    { 0x123456789abcdefULL, 3, 2, 1, 0 },
-    { 0x789abcdef0123456ULL, 0, 0, 4, 0 },
-    { 0x8000000000000000ULL, 0, 0, 0, 1 },
-    { 0x8000000000000001ULL, 0, 0, 0, 1 },
-    { 0xfffffffffffffffeULL, 7, 15, 31, 63 },
-    { 0xffffffffffffffffULL, 8, 16, 32, 64 },
-  };
-
-TEST_STDBIT_UI_TOPLEVEL (stdc_leading_ones);
-
-static int
-do_test (void)
-{
-  TEST_STDBIT_UI (stdc_leading_ones, inputs);
-  return 0;
-}
-
-#include <support/test-driver.c>
diff --git a/tests/tst-stdc_leading_zeros.c b/tests/tst-stdc_leading_zeros.c
deleted file mode 100644 (file)
index 3452908..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Test stdc_leading_zeros functions and macros.
-   Copyright (C) 2024 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <tst-stdbit.h>
-
-static const struct stdbit_test inputs[] =
-  {
-    { 0ULL, 8, 16, 32, 64 },
-    { 0x1ULL, 7, 15, 31, 63 },
-    { 0x2ULL, 6, 14, 30, 62 },
-    { 0x3ULL, 6, 14, 30, 62 },
-    { 0x4ULL, 5, 13, 29, 61 },
-    { 0x5ULL, 5, 13, 29, 61 },
-    { 0x6ULL, 5, 13, 29, 61 },
-    { 0x7ULL, 5, 13, 29, 61 },
-    { 0x8ULL, 4, 12, 28, 60 },
-    { 0x9ULL, 4, 12, 28, 60 },
-    { 0xaULL, 4, 12, 28, 60 },
-    { 0xbULL, 4, 12, 28, 60 },
-    { 0xcULL, 4, 12, 28, 60 },
-    { 0xdULL, 4, 12, 28, 60 },
-    { 0xeULL, 4, 12, 28, 60 },
-    { 0xfULL, 4, 12, 28, 60 },
-    { 0x10ULL, 3, 11, 27, 59 },
-    { 0x11ULL, 3, 11, 27, 59 },
-    { 0x12ULL, 3, 11, 27, 59 },
-    { 0x1fULL, 3, 11, 27, 59 },
-    { 0x20ULL, 2, 10, 26, 58 },
-    { 0x7fULL, 1, 9, 25, 57 },
-    { 0x80ULL, 0, 8, 24, 56 },
-    { 0x81ULL, 0, 8, 24, 56 },
-    { 0x9aULL, 0, 8, 24, 56 },
-    { 0xf3ULL, 0, 8, 24, 56 },
-    { 0xffULL, 0, 8, 24, 56 },
-    { 0x100ULL, 8, 7, 23, 55 },
-    { 0x101ULL, 7, 7, 23, 55 },
-    { 0x102ULL, 6, 7, 23, 55 },
-    { 0x1feULL, 0, 7, 23, 55 },
-    { 0x1ffULL, 0, 7, 23, 55 },
-    { 0x200ULL, 8, 6, 22, 54 },
-    { 0x234ULL, 2, 6, 22, 54 },
-    { 0x4567ULL, 1, 1, 17, 49 },
-    { 0x7fffULL, 0, 1, 17, 49 },
-    { 0x8000ULL, 8, 0, 16, 48 },
-    { 0x8001ULL, 7, 0, 16, 48 },
-    { 0xfffeULL, 0, 0, 16, 48 },
-    { 0xffffULL, 0, 0, 16, 48 },
-    { 0x10000ULL, 8, 16, 15, 47 },
-    { 0x10001ULL, 7, 15, 15, 47 },
-    { 0xfedcba98ULL, 0, 0, 0, 32 },
-    { 0xfffffefeULL, 0, 0, 0, 32 },
-    { 0xffffffffULL, 0, 0, 0, 32 },
-    { 0x100000000ULL, 8, 16, 32, 31 },
-    { 0x100000001ULL, 7, 15, 31, 31 },
-    { 0x123456789ULL, 0, 1, 2, 31 },
-    { 0x123456789abcdefULL, 0, 0, 0, 7 },
-    { 0x789abcdef0123456ULL, 1, 2, 0, 1 },
-    { 0x8000000000000000ULL, 8, 16, 32, 0 },
-    { 0x8000000000000001ULL, 7, 15, 31, 0 },
-    { 0xfffffffffffffffeULL, 0, 0, 0, 0 },
-    { 0xffffffffffffffffULL, 0, 0, 0, 0 },
-  };
-
-TEST_STDBIT_UI_TOPLEVEL (stdc_leading_zeros);
-
-static int
-do_test (void)
-{
-  TEST_STDBIT_UI (stdc_leading_zeros, inputs);
-  return 0;
-}
-
-#include <support/test-driver.c>
diff --git a/tests/tst-stdc_trailing_ones.c b/tests/tst-stdc_trailing_ones.c
deleted file mode 100644 (file)
index 6fcd9d8..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Test stdc_trailing_ones functions and macros.
-   Copyright (C) 2024 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <tst-stdbit.h>
-
-static const struct stdbit_test inputs[] =
-  {
-    { 0ULL, 0, 0, 0, 0 },
-    { 0x1ULL, 1, 1, 1, 1 },
-    { 0x2ULL, 0, 0, 0, 0 },
-    { 0x3ULL, 2, 2, 2, 2 },
-    { 0x4ULL, 0, 0, 0, 0 },
-    { 0x5ULL, 1, 1, 1, 1 },
-    { 0x6ULL, 0, 0, 0, 0 },
-    { 0x7ULL, 3, 3, 3, 3 },
-    { 0x8ULL, 0, 0, 0, 0 },
-    { 0x9ULL, 1, 1, 1, 1 },
-    { 0xaULL, 0, 0, 0, 0 },
-    { 0xbULL, 2, 2, 2, 2 },
-    { 0xcULL, 0, 0, 0, 0 },
-    { 0xdULL, 1, 1, 1, 1 },
-    { 0xeULL, 0, 0, 0, 0 },
-    { 0xfULL, 4, 4, 4, 4 },
-    { 0x10ULL, 0, 0, 0, 0 },
-    { 0x11ULL, 1, 1, 1, 1 },
-    { 0x12ULL, 0, 0, 0, 0 },
-    { 0x1fULL, 5, 5, 5, 5 },
-    { 0x20ULL, 0, 0, 0, 0 },
-    { 0x7fULL, 7, 7, 7, 7 },
-    { 0x80ULL, 0, 0, 0, 0 },
-    { 0x81ULL, 1, 1, 1, 1 },
-    { 0x9aULL, 0, 0, 0, 0 },
-    { 0xf3ULL, 2, 2, 2, 2 },
-    { 0xffULL, 8, 8, 8, 8 },
-    { 0x100ULL, 0, 0, 0, 0 },
-    { 0x101ULL, 1, 1, 1, 1 },
-    { 0x102ULL, 0, 0, 0, 0 },
-    { 0x1feULL, 0, 0, 0, 0 },
-    { 0x1ffULL, 8, 9, 9, 9 },
-    { 0x200ULL, 0, 0, 0, 0 },
-    { 0x234ULL, 0, 0, 0, 0 },
-    { 0x4567ULL, 3, 3, 3, 3 },
-    { 0x7fffULL, 8, 15, 15, 15 },
-    { 0x8000ULL, 0, 0, 0, 0 },
-    { 0x8001ULL, 1, 1, 1, 1 },
-    { 0xfffeULL, 0, 0, 0, 0 },
-    { 0xffffULL, 8, 16, 16, 16 },
-    { 0x10000ULL, 0, 0, 0, 0 },
-    { 0x10001ULL, 1, 1, 1, 1 },
-    { 0xfedcba98ULL, 0, 0, 0, 0 },
-    { 0xfffffefeULL, 0, 0, 0, 0 },
-    { 0xffffffffULL, 8, 16, 32, 32 },
-    { 0x100000000ULL, 0, 0, 0, 0 },
-    { 0x100000001ULL, 1, 1, 1, 1 },
-    { 0x123456789ULL, 1, 1, 1, 1 },
-    { 0x123456789abcdefULL, 4, 4, 4, 4 },
-    { 0x789abcdef0123456ULL, 0, 0, 0, 0 },
-    { 0x8000000000000000ULL, 0, 0, 0, 0 },
-    { 0x8000000000000001ULL, 1, 1, 1, 1 },
-    { 0xfffffffffffffffeULL, 0, 0, 0, 0 },
-    { 0xffffffffffffffffULL, 8, 16, 32, 64 },
-  };
-
-TEST_STDBIT_UI_TOPLEVEL (stdc_trailing_ones);
-
-static int
-do_test (void)
-{
-  TEST_STDBIT_UI (stdc_trailing_ones, inputs);
-  return 0;
-}
-
-#include <support/test-driver.c>
diff --git a/tests/tst-stdc_trailing_zeros.c b/tests/tst-stdc_trailing_zeros.c
deleted file mode 100644 (file)
index a7664ee..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Test stdc_trailing_zeros functions and macros.
-   Copyright (C) 2024 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
-   <https://www.gnu.org/licenses/>.  */
-
-#include <tst-stdbit.h>
-
-static const struct stdbit_test inputs[] =
-  {
-    { 0ULL, 8, 16, 32, 64 },
-    { 0x1ULL, 0, 0, 0, 0 },
-    { 0x2ULL, 1, 1, 1, 1 },
-    { 0x3ULL, 0, 0, 0, 0 },
-    { 0x4ULL, 2, 2, 2, 2 },
-    { 0x5ULL, 0, 0, 0, 0 },
-    { 0x6ULL, 1, 1, 1, 1 },
-    { 0x7ULL, 0, 0, 0, 0 },
-    { 0x8ULL, 3, 3, 3, 3 },
-    { 0x9ULL, 0, 0, 0, 0 },
-    { 0xaULL, 1, 1, 1, 1 },
-    { 0xbULL, 0, 0, 0, 0 },
-    { 0xcULL, 2, 2, 2, 2 },
-    { 0xdULL, 0, 0, 0, 0 },
-    { 0xeULL, 1, 1, 1, 1 },
-    { 0xfULL, 0, 0, 0, 0 },
-    { 0x10ULL, 4, 4, 4, 4 },
-    { 0x11ULL, 0, 0, 0, 0 },
-    { 0x12ULL, 1, 1, 1, 1 },
-    { 0x1fULL, 0, 0, 0, 0 },
-    { 0x20ULL, 5, 5, 5, 5 },
-    { 0x7fULL, 0, 0, 0, 0 },
-    { 0x80ULL, 7, 7, 7, 7 },
-    { 0x81ULL, 0, 0, 0, 0 },
-    { 0x9aULL, 1, 1, 1, 1 },
-    { 0xf3ULL, 0, 0, 0, 0 },
-    { 0xffULL, 0, 0, 0, 0 },
-    { 0x100ULL, 8, 8, 8, 8 },
-    { 0x101ULL, 0, 0, 0, 0 },
-    { 0x102ULL, 1, 1, 1, 1 },
-    { 0x1feULL, 1, 1, 1, 1 },
-    { 0x1ffULL, 0, 0, 0, 0 },
-    { 0x200ULL, 8, 9, 9, 9 },
-    { 0x234ULL, 2, 2, 2, 2 },
-    { 0x4567ULL, 0, 0, 0, 0 },
-    { 0x7fffULL, 0, 0, 0, 0 },
-    { 0x8000ULL, 8, 15, 15, 15 },
-    { 0x8001ULL, 0, 0, 0, 0 },
-    { 0xfffeULL, 1, 1, 1, 1 },
-    { 0xffffULL, 0, 0, 0, 0 },
-    { 0x10000ULL, 8, 16, 16, 16 },
-    { 0x10001ULL, 0, 0, 0, 0 },
-    { 0xfedcba98ULL, 3, 3, 3, 3 },
-    { 0xfffffefeULL, 1, 1, 1, 1 },
-    { 0xffffffffULL, 0, 0, 0, 0 },
-    { 0x100000000ULL, 8, 16, 32, 32 },
-    { 0x100000001ULL, 0, 0, 0, 0 },
-    { 0x123456789ULL, 0, 0, 0, 0 },
-    { 0x123456789abcdefULL, 0, 0, 0, 0 },
-    { 0x789abcdef0123456ULL, 1, 1, 1, 1 },
-    { 0x8000000000000000ULL, 8, 16, 32, 63 },
-    { 0x8000000000000001ULL, 0, 0, 0, 0 },
-    { 0xfffffffffffffffeULL, 1, 1, 1, 1 },
-    { 0xffffffffffffffffULL, 0, 0, 0, 0 },
-  };
-
-TEST_STDBIT_UI_TOPLEVEL (stdc_trailing_zeros);
-
-static int
-do_test (void)
-{
-  TEST_STDBIT_UI (stdc_trailing_zeros, inputs);
-  return 0;
-}
-
-#include <support/test-driver.c>