math: test-matherr and test-matherr-2 can be regular tests
authorFlorian Weimer <fweimer@redhat.com>
Tue, 9 Mar 2021 20:07:24 +0000 (21:07 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 9 Mar 2021 20:07:24 +0000 (21:07 +0100)
compat_symbol_reference is now available without tests-internal.
Do not build the test at all on glibc versions that lack the symbols,
to avoid spurious UNSUPPORTED results.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
math/Makefile
math/test-matherr.c

index 2978abf..98b26e4 100644 (file)
@@ -249,7 +249,11 @@ tests-static = test-fpucw-static test-fpucw-ieee-static \
               test-signgam-uchar-static test-signgam-uchar-init-static \
               test-signgam-uint-static test-signgam-uint-init-static \
               test-signgam-ullong-static test-signgam-ullong-init-static
-tests-internal = test-matherr test-matherr-2
+
+# The tested symbols matherr, _LIB_VERSION have been removed in glibc 2.27.
+ifeq ($(have-GLIBC_2.26)$(build-shared),yesyes)
+tests += test-matherr test-matherr-2
+endif
 
 # These tests use internal (unexported) GMP functions and are linked
 # statically to obtain access to these functions.
index e68a4a3..aed396e 100644 (file)
 #include <math-svid-compat.h>
 #include <shlib-compat.h>
 
-#if TEST_COMPAT (libm, GLIBC_2_0, GLIBC_2_27)
-
-# undef matherr
-# undef _LIB_VERSION
+#undef matherr
+#undef _LIB_VERSION
 compat_symbol_reference (libm, matherr, matherr, GLIBC_2_0);
 compat_symbol_reference (libm, _LIB_VERSION, _LIB_VERSION, GLIBC_2_0);
 
@@ -47,12 +45,5 @@ do_test (void)
   acos (2.0);
   return fail;
 }
-#else
-static int
-do_test (void)
-{
-  return 77;
-}
-#endif
 
 #include <support/test-driver.c>