public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] math: test-matherr and test-matherr-2 can be regular tests
@ 2021-03-09 20:10 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2021-03-09 20:10 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=779c404de7910eb417f12767551fad389633c716

commit 779c404de7910eb417f12767551fad389633c716
Author: Florian Weimer <fweimer@redhat.com>
Date:   Tue Mar 9 21:07:24 2021 +0100

    math: test-matherr and test-matherr-2 can be regular tests
    
    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>

Diff:
---
 math/Makefile       |  6 +++++-
 math/test-matherr.c | 13 ++-----------
 2 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/math/Makefile b/math/Makefile
index 2978abf526..98b26e4f71 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -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.
diff --git a/math/test-matherr.c b/math/test-matherr.c
index e68a4a3af1..aed396e420 100644
--- a/math/test-matherr.c
+++ b/math/test-matherr.c
@@ -23,10 +23,8 @@
 #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>


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-09 20:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-09 20:10 [glibc] math: test-matherr and test-matherr-2 can be regular tests Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).