This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Add more thorough generated tgmath.h test [committed]
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 28 Jun 2017 11:48:23 -0700
- Subject: Re: Add more thorough generated tgmath.h test [committed]
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.2.20.1706281420430.19888@digraph.polyomino.org.uk>
On Wed, Jun 28, 2017 at 7:21 AM, Joseph Myers <joseph@codesourcery.com> wrote:
> This patch adds a more thorough test of tgmath.h macros, verifying
> both the return type and the function called for all the cases of
> valid argument types. (Cases with current problems - I've just filed
> four bugs - are disabled or omitted pending fixing those problems.)
> The test uses a Python generator (works with both Python 2 and 3) to
> generate a C file which is then built and run as a test in the usual
> way (and that C file includes its own dummy definitions of libm
> functions similar to existing tgmath.h tests). The motivation is to
> make it easier to add tests of tgmath.h for _Float128 when adding
> tgmath.h support for that type; the _FloatN / _FloatNx support is
> present in the script, but disabled until the tgmath.h support is
> written.
>
> Tested for x86_64, and for arm to check things in the long double =
> double case. (In that case, it's OK to call either double or long
> double functions when the selected type is double or long double, as
> long as the return type of the macro is exactly correct.) Committed.
>
> 2017-06-28 Joseph Myers <joseph@codesourcery.com>
>
> * math/gen-tgmath-tests.py: New file.
> * math/Makefile [PYTHON] (tests): Add test-tgmath3.
> [PYTHON] (generated): Add test-tgmath3.c.
> [PYTHON] (CFLAGS-test-tgmath3.c): New variable.
> [PYTHON] ($(objpfx)test-tgmath3.c): New rule.
>
>
With GCC 7.1.1 on i686, I got
/export/build/gnu/glibc-32bit-test/build-i686-linux/math/test-tgmath3.c:130745:21:
error: ‘FLT128_MANT_DIG’ undeclared (first use in this function); did
you mean ‘FLT_MANT_DIG’?
called_mant_dig = FLT128_MANT_DIG;
^~~~~~~~~~~~~~~
FLT_MANT_DIG
/export/build/gnu/glibc-32bit-test/build-i686-linux/math/test-tgmath3.c:
In function ‘conjf128’:
/export/build/gnu/glibc-32bit-test/build-i686-linux/math/test-tgmath3.c:131030:21:
error: ‘FLT128_MANT_DIG’ undeclared (first use in this function); did
you mean ‘FLT_MANT_DIG’?
called_mant_dig = FLT128_MANT_DIG;
^~~~~~~~~~~~~~~
FLT_MANT_DIG
/export/build/gnu/glibc-32bit-test/build-i686-linux/math/test-tgmath3.c:
In function ‘cprojf128’:
/export/build/gnu/glibc-32bit-test/build-i686-linux/math/test-tgmath3.c:131315:21:
error: ‘FLT128_MANT_DIG’ undeclared (first use in this function); did
you mean ‘FLT_MANT_DIG’?
called_mant_dig = FLT128_MANT_DIG;
^~~~~~~~~~~~~~~
FLT_MANT_DIG
/export/build/gnu/glibc-32bit-test/build-i686-linux/math/test-tgmath3.c:
In function ‘crealf128’:
/export/build/gnu/glibc-32bit-test/build-i686-linux/math/test-tgmath3.c:131600:21:
error: ‘FLT128_MANT_DIG’ undeclared (first use in this function); did
you mean ‘FLT_MANT_DIG’?
called_mant_dig = FLT128_MANT_DIG;
^~~~~~~~~~~~~~~
FLT_MANT_DIG
/export/build/gnu/glibc-32bit-test/build-i686-linux/math/test-tgmath3.c:
In function ‘roundevenf128’:
/export/build/gnu/glibc-32bit-test/build-i686-linux/math/test-tgmath3.c:131885:21:
error: ‘FLT128_MANT_DIG’ undeclared (first use in this function); did
you mean ‘FLT_MANT_DIG’?
called_mant_dig = FLT128_MANT_DIG;
^~~~~~~~~~~~~~~
FLT_MANT_DIG
/export/build/gnu/glibc-32bit-test/build-i686-linux/math/test-tgmath3.c:
In function ‘nextupf128’:
/export/build/gnu/glibc-32bit-test/build-i686-linux/math/test-tgmath3.c:132104:21:
error: ‘FLT128_MANT_DIG’ undeclared (first use in this function); did
you mean ‘FLT_MANT_DIG’?
called_mant_dig = FLT128_MANT_DIG;
^~~~~~~~~~~~~~~
FLT_MANT_DIG
H.J.