Add more thorough generated tgmath.h test.
authorJoseph Myers <joseph@codesourcery.com>
Wed, 28 Jun 2017 14:20:21 +0000 (14:20 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 28 Jun 2017 14:20:21 +0000 (14:20 +0000)
commit2dd0aec531ad03e8e1642f8642930451b23fe2ba
tree269fb8bbec8b2830f52aba1e5065b43740fd82cb
parent073e8fa7739ed453d6854b834f290c263a6cdb9f
Add more thorough generated tgmath.h test.

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.)

* 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.
ChangeLog
math/Makefile
math/gen-tgmath-tests.py [new file with mode: 0755]