diff --git a/SHARED-FILES b/SHARED-FILES index b630b41209..f17a76dbf7 100644 --- a/SHARED-FILES +++ b/SHARED-FILES @@ -113,6 +113,7 @@ gnulib: stdlib/setenv.c stdlib/strtoll.c stdlib/strtoul.c + # Merged from gnulib 2026-08-27, (gnulib commit ec224ee81b) stdlib/tst-stdc_rotate_left.c stdlib/tst-stdc_rotate_right.c # Merged from gnulib 2014-6-26, needs merge back diff --git a/stdlib/tst-stdc_rotate_left.c b/stdlib/tst-stdc_rotate_left.c index e4b8052969..ec89f4ae52 100644 --- a/stdlib/tst-stdc_rotate_left.c +++ b/stdlib/tst-stdc_rotate_left.c @@ -15,8 +15,27 @@ License along with the GNU C Library; if not, see . */ +#ifdef GNULIB_TEST_STDBIT +# include +#endif + +/* Specification. */ #include -#include + +#include + +#ifdef GNULIB_TEST_STDBIT +# include "macros.h" +# define MAIN_STATIC +# define MAIN main +# define TEST_COMPARE(a, b) ASSERT ((a) == (b)) +# define TEST_EXIT_STATUS test_exit_status +#else +# include +# define MAIN_STATIC static +# define MAIN do_test +# define TEST_EXIT_STATUS 0 +#endif #define TEST_CASE(type, function, value, shift, expect) \ do \ @@ -431,10 +450,11 @@ test_stdc_rotate_left_ui (void) static void test_stdc_rotate_left_ul (void) { - if (sizeof 0ul < sizeof 0ull) - TEST_CASES_32 (unsigned long int, stdc_rotate_left_ul); - else - TEST_CASES_64 (unsigned long long int, stdc_rotate_left_ul); +#if ULONG_MAX >> 31 == 1 + TEST_CASES_32 (unsigned long int, stdc_rotate_left_ul); +#else + TEST_CASES_64 (unsigned long int, stdc_rotate_left_ul); +#endif } static void @@ -443,15 +463,17 @@ test_stdc_rotate_left_ull (void) TEST_CASES_64 (unsigned long long int, stdc_rotate_left_ull); } -static int -do_test (void) +MAIN_STATIC int +MAIN (void) { test_stdc_rotate_left_uc (); test_stdc_rotate_left_us (); test_stdc_rotate_left_ui (); test_stdc_rotate_left_ul (); test_stdc_rotate_left_ull (); - return 0; + return TEST_EXIT_STATUS; } -#include +#ifndef GNULIB_TEST_STDBIT +# include +#endif diff --git a/stdlib/tst-stdc_rotate_right.c b/stdlib/tst-stdc_rotate_right.c index d9543b8b55..01b28cd957 100644 --- a/stdlib/tst-stdc_rotate_right.c +++ b/stdlib/tst-stdc_rotate_right.c @@ -15,8 +15,27 @@ License along with the GNU C Library; if not, see . */ +#ifdef GNULIB_TEST_STDBIT +# include +#endif + +/* Specification. */ #include -#include + +#include + +#ifdef GNULIB_TEST_STDBIT +# include "macros.h" +# define MAIN_STATIC +# define MAIN main +# define TEST_COMPARE(a, b) ASSERT ((a) == (b)) +# define TEST_EXIT_STATUS test_exit_status +#else +# include +# define MAIN_STATIC static +# define MAIN do_test +# define TEST_EXIT_STATUS 0 +#endif #define TEST_CASE(type, function, value, shift, expect) \ do \ @@ -431,10 +450,11 @@ test_stdc_rotate_right_ui (void) static void test_stdc_rotate_right_ul (void) { - if (sizeof 0ul < sizeof 0ull) - TEST_CASES_32 (unsigned long int, stdc_rotate_right_ul); - else - TEST_CASES_64 (unsigned long long int, stdc_rotate_right_ul); +#if ULONG_MAX >> 31 == 1 + TEST_CASES_32 (unsigned long int, stdc_rotate_right_ul); +#else + TEST_CASES_64 (unsigned long int, stdc_rotate_right_ul); +#endif } static void @@ -443,15 +463,17 @@ test_stdc_rotate_right_ull (void) TEST_CASES_64 (unsigned long long int, stdc_rotate_right_ull); } -static int -do_test (void) +MAIN_STATIC int +MAIN (void) { test_stdc_rotate_right_uc (); test_stdc_rotate_right_us (); test_stdc_rotate_right_ui (); test_stdc_rotate_right_ul (); test_stdc_rotate_right_ull (); - return 0; + return TEST_EXIT_STATUS; } -#include +#ifndef GNULIB_TEST_STDBIT +# include +#endif