From d12a22c5d351cd1cc125a6345a949dfbc20f6f91 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 28 Jun 2017 16:31:10 +0000 Subject: Fix tgmath.h totalorder, totalordermag return type (bug 21687). The tgmath.h totalorder and totalordermag macros wrongly return a floating-point type. They should return int, like the underlying functions. This patch fixes them accordingly, updating tests including enabling tests of those functions from gen-tgmath-tests.py. Tested for x86_64. [BZ #21687] * math/tgmath.h (__TGMATH_BINARY_REAL_RET_ONLY): New macro. (totalorder): Use it. (totalordermag): Likewise. * math/gen-tgmath-tests.py (Tests.add_all_tests): Enable tests of totalorder and totalordermag. * math/test-tgmath.c (F(compile_test)): Do not call totalorder or totalordermag in arguments of calls to those functions. (NCALLS): Change to 134. --- math/gen-tgmath-tests.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'math/gen-tgmath-tests.py') diff --git a/math/gen-tgmath-tests.py b/math/gen-tgmath-tests.py index 3dbd874..db6553e 100755 --- a/math/gen-tgmath-tests.py +++ b/math/gen-tgmath-tests.py @@ -549,8 +549,8 @@ class Tests(object): self.add_tests('fromfpx', 'intmax_t', ['r', 'int', 'unsigned int']) self.add_tests('ufromfp', 'uintmax_t', ['r', 'int', 'unsigned int']) self.add_tests('ufromfpx', 'uintmax_t', ['r', 'int', 'unsigned int']) - #self.add_tests('totalorder', 'int', ['r', 'r']) - #self.add_tests('totalordermag', 'int', ['r', 'r']) + self.add_tests('totalorder', 'int', ['r', 'r']) + self.add_tests('totalordermag', 'int', ['r', 'r']) # The functions that round their result to a narrower type, # and the associated type-generic macros, are not yet # supported by this script or by glibc. -- cgit v1.1