about summary refs log tree commit diff
path: root/sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2017-02-06 23:23:54 +0000
committerJoseph Myers <joseph@codesourcery.com>2017-02-06 23:23:54 +0000
commitdcd4cd575678c94f042c1a6b08663c648781a9eb (patch)
treec9a8d1a8949f27140a8cb4844474d4f095d78ba2 /sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S
parenta622c2db5511e9633870e3ced9fb2406e4ebdb09 (diff)
downloadglibc-dcd4cd575678c94f042c1a6b08663c648781a9eb.tar.gz
glibc-dcd4cd575678c94f042c1a6b08663c648781a9eb.tar.xz
glibc-dcd4cd575678c94f042c1a6b08663c648781a9eb.zip
Refactor some code in libm-test-driver.c.
Splitting libm tests by function will mean about a thousand such tests
built separately instead of the present nine (plus vector variants).

When this is done, it's desirable to avoid needing to build all the
test infrastructure so many times.  Also, simply including
libm-test-driver.c as-is into per-function tests doesn't actually
work, because the various check_* functions are not used by all tests
and so generate errors for unused static functions.

Although some pieces of infrastructure depend on the type being tested
while others don't, building once per type seems the simplest
approach.  This patch makes changes to libm-test-driver.c in
preparation for that.  Various cases where functions directly use
macros such as TEST_ERRNO (that may vary depending on things other
than the type under test) are changed to use variables initialized
using those macros, while most of the code in main is moved out to
functions libm_test_init and libm_test_fini.

The idea is that all the functions in libm-test-driver.c will be moved
out in a subsequent patch to be built once per type (and be no longer
static when they are used from per-function tests), while
libm-test-driver.c remains containing definitions of various variables
(no longer static, of course, because they'll be used in the per-type
code) and the main function.  Declarations / macros relevant to both
the once-per-type code and the per-function tests will go in a shared
header.

Tested for x86_64.

	* math/libm-test-driver.c (flag_test_errno): New variable.
	(flag_test_exceptions): Likewise.
	(flag_test_finite): Likewise.
	(flag_test_inline): Likewise.
	(flag_test_mathvec): Likewise.
	(test_msg): Likewise.
	(ulp_idx): Likewise.
	(qtype_str): Likewise.
	(ULP_IDX): Remove macro.
	(QTYPE_STR): Likewise.
	(find_ulps): Use ulp_idx not ULP_IDX.
	(print_function_ulps): Use qtype_str, printed with %s, not
	QTYPE_STR, printed with concatentation to format string.
	(print_complex_function_ulps): Likewise.
	(test_exceptions): Use flag_test_exceptions not TEST_EXCEPTIONS.
	(test_errno): Use flag_test_errno not TEST_ERRNO.
	(enable_test): Use flag_test_inline, flag_test_finite and
	flag_test_mathvec instead of TEST_INLINE, TEST_FINITE and
	TEST_MATHVEC.
	(libm_test_init): New function.  Factored out of main.
	(libm_test_finish): Likewise.
	(main): Call libm_test_init and libm_test_finish and move most
	code to those functions.
Diffstat (limited to 'sysdeps/powerpc/powerpc64/multiarch/strcasestr-power8.S')
0 files changed, 0 insertions, 0 deletions