1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

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.
This commit is contained in:
Joseph Myers
2017-06-28 16:31:10 +00:00
parent cfa4434523
commit d12a22c5d3
4 changed files with 31 additions and 9 deletions

View File

@ -52,7 +52,7 @@ int count_cdouble;
int count_cfloat;
int count_cldouble;
#define NCALLS 138
#define NCALLS 134
#define NCALLS_INT 4
#define NCCALLS 47
@ -295,8 +295,8 @@ F(compile_test) (void)
b = fmaxmag (fmaxmag (a, x), fmaxmag (c, b));
a = fminmag (fminmag (x, a), fminmag (c, b));
b = fma (sin (a), sin (x), sin (c));
a = totalorder (totalorder (x, b), totalorder (c, x));
b = totalordermag (totalordermag (x, a), totalordermag (c, x));
a = totalorder (x, b);
b = totalordermag (x, a);
#ifdef TEST_INT
a = atan2 (i, b);