Commit Graph

24 Commits

Author SHA1 Message Date
Joseph Myers 04277e02d7 Update copyright dates with scripts/update-copyrights.
* All files with FSF copyright notices: Update copyright dates
	using scripts/update-copyrights.
	* locale/programs/charmap-kw.h: Regenerated.
	* locale/programs/locfile-kw.h: Likewise.
2019-01-01 00:11:28 +00:00
Joseph Myers 688903eb3e Update copyright dates with scripts/update-copyrights.
* All files with FSF copyright notices: Update copyright dates
	using scripts/update-copyrights.
	* locale/programs/charmap-kw.h: Regenerated.
	* locale/programs/locfile-kw.h: Likewise.
2018-01-01 00:32:25 +00:00
Florian Weimer 3ec7c02cc3 x86-64: memcmp-avx2-movbe.S needs saturating subtraction [BZ #21662]
This code:

L(between_2_3):
	/* Load as big endian with overlapping loads and bswap to avoid
	   branches.  */
	movzwl	-2(%rdi, %rdx), %eax
	movzwl	-2(%rsi, %rdx), %ecx
	shll	$16, %eax
	shll	$16, %ecx
	movzwl	(%rdi), %edi
	movzwl	(%rsi), %esi
	orl	%edi, %eax
	orl	%esi, %ecx
	bswap	%eax
	bswap	%ecx
	subl	%ecx, %eax
	ret

needs a saturating subtract because the full register is used.
With this commit, only the lower 24 bits of the register are used,
so a regular subtraction suffices.

The test case change adds coverage for these kinds of bugs.
2017-06-23 17:24:40 +02:00
Wainer dos Santos Moschetta fb82116f24 Update string tests to use the support test driver.
Replaced all imports of test-skeleton.c with support/test-driver.c.

In some cases it was needed to adjust do_test to return int
instead of static int since that is the method's signature expected by
test-driver.c.

Checked on x86_64.

	* string/test-string.h (TEST_FUNCTION): Use test_main instead of
	test_main ().
	(CMDLINE_PROCESS): Use function instead of defined macro.
	* debug/test-strcpy_chk.c: Import support/test-driver.c and also
	<suppport/support.h> to use set_fortify_handler().
	* string/bug-envz1.c: Import support/test-driver.c instead of
	test-skeleton.c.
	* string/bug-strcoll2.c: Likewise.
	* string/bug-strtok1.c: Likewise.
	* string/stratcliff.c: Likewise.
	* string/test-ffs.c: Likewise.
	* string/test-memccpy.c: Likewise.
	* string/test-memchr.c: Likewise.
	* string/test-memcmp.c: Likewise.
	* string/test-memcpy.c: Likewise.
	* string/test-memmem.c: Likewise.
	* string/test-memmove.c: Likewise.
	* string/test-memrchr.c: Likewise.
	* string/test-memset.c: Likewise.
	* string/test-rawmemchr.c: Likewise.
	* string/test-strcasecmp.c: Likewise.
	* string/test-strcasestr.c: Likewise.
	* string/test-strcat.c: Likewise.
	* string/test-strchr.c: Likewise.
	* string/test-strcmp.c: Likewise.
	* string/test-strcpy.c: Likewise.
	* string/test-string.h: Likewise.
	* string/test-strlen.c: Likewise.
	* string/test-strncasecmp.c: Likewise.
	* string/test-strncat.c: Likewise.
	* string/test-strncmp.c: Likewise.
	* string/test-strncpy.c: Likewise.
	* string/test-strnlen.c: Likewise.
	* string/test-strpbrk.c: Likewise.
	* string/test-strrchr.c: Likewise.
	* string/test-strspn.c: Likewise.
	* string/test-strstr.c: Likewise.
	* string/tst-bswap.c: Likewise.
	* string/tst-cmp.c: Likewise.
	* string/tst-endian.c: Likewise.
	* string/tst-inlcall.c: Likewise.
	* string/tst-strcoll-overflow.c: Likewise.
	* string/tst-strfry.c: Likewise.
	* string/tst-strlen.c: Likewise.
	* string/tst-strtok.c: Likewise.
	* string/tst-strtok_r.c: Likewise.
	* string/tst-strxfrm.c: Likewise.
	* string/tst-strxfrm2.c: Likewise.
	* string/tst-svc.c: Likewise.
	* string/tst-svc2.c: Likewise.
2017-03-23 11:32:29 -03:00
Joseph Myers bfff8b1bec Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Joseph Myers f7a9f785e5 Update copyright dates with scripts/update-copyrights. 2016-01-04 16:05:18 +00:00
Joseph Myers b168057aaa Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
Allan McRae d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
H.J. Lu bb5bb87cd2 Add a test for BZ #15674 2013-06-26 15:23:08 -07:00
Siddhesh Poyarekar fec799f823 Remove performance-related bits from string tests 2013-06-11 15:08:13 +05:30
Joseph Myers 568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
H.J. Lu 69f07e5fd1 Add string IFUNC tests 2012-10-19 22:10:16 -07:00
Thomas Schwinge 302cadd343 Testsuite #include fixes. 2012-04-02 22:31:32 +02:00
Paul Eggert 59ba27a63a Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
Liubov Dmitrieva be13f7bff6 Optimized memcmp and wmemcmp for x86-64 and x86-32 2011-10-15 11:10:08 -04:00
Liubov Dmitrieva 42622229a9 delete 4 lines with unused "define" macros in test-memcmp 2011-10-07 11:52:49 -04:00
Liubov Dmitrieva 4badf7e8d7 New comprehensive test for wmemcmp 2011-09-08 17:51:50 -04:00
H.J. Lu 8863605af9 Test case for last x86 memcmp problem 2010-03-24 12:14:03 -07:00
Roland McGrath 0317eaecb1 * posix/tst-execle1.c (do_test): Add a const.
* posix/tst-execle2.c (do_test): Likewise.

	* posix/transbug.c (run_test): Add some casts.
	* posix/bug-regex22.c (main): Likewise.
	* posix/bug-regex5.c (main): Likewise.
	* wcsmbs/tst-mbsrtowcs.c (main): Likewise.
	* string/test-strspn.c (do_test, do_random_tests): Likewise.
	* string/test-strrchr.c (do_test, do_random_tests): Likewise.
	* string/test-strlen.c (do_random_tests): Likewise.
	* string/test-strpbrk.c (do_test, do_random_tests): Likewise.
	* string/test-strcmp.c (do_random_tests): Likewise.
	* string/test-strchr.c (do_test, do_random_tests): Likewise.
	* string/test-strcat.c (do_test, do_random_tests): Likewise.
	* string/test-strncpy.c (do_random_tests): Likewise.
	* string/test-strcpy.c (do_test, do_random_tests): Likewise.
	* string/test-memccpy.c (do_test): Likewise.
	* string/test-memmove.c (do_test, do_random_tests): Likewise.
	* string/test-memcpy.c (do_test, do_random_tests): Likewise.
	* string/test-memcmp.c (do_test, do_random_tests): Likewise.
	* string/test-memchr.c (do_test, do_random_tests): Likewise.
	* dlfcn/bug-atexit1.c (do_test): Fix up prototype in cast.
	* stdio-common/tst-fgets.c (do_test): Add a cast.
	* iconvdata/bug-iconv4.c (xiconv): Add a cast.

	* locale/programs/simple-hash.c (insert_entry_2): Remove useless casts.

	* resolv/herror.c (herror): Remove unused extern decl.

	* libio/obprintf.c: Include "strfile.h".

	* elf/order2mod2.c (init): Cast ignored value to void.

	* stdio-common/tstdiomisc.c: If FLT_EVAL_METHOD is 2, use long
2005-12-27 22:50:12 +00:00
Ulrich Drepper a334319f65 (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4. 2004-12-22 20:10:10 +00:00
Jakub Jelinek 0ecb606cb6 2.5-18.1 2007-07-12 18:26:36 +00:00
Ulrich Drepper c9df3df9d2 Update.
* string/test-memchr.c: Likewise.
	* string/test-memcmp.c: Likewise.
	* string/test-memcpy.c: Likewise.
	* string/test-memmove.c: Likewise.
	* string/test-memset.c: Likewise.
	* string/test-strcat.c: Likewise.
	* string/test-strchr.c: Likewise.
	* string/test-strcmp.c: Likewise.
	* string/test-strcpy.c: Likewise.
	* string/test-strlen.c: Likewise.
	* string/test-strncmp.c: Likewise.
	* string/test-strpbrk.c: Likewise.
	* string/test-strrchr.c: Likewise.
	* string/test-strspn.c: Likewise.
2003-04-17 17:38:38 +00:00
Roland McGrath 9fb0cae85c * string/test-strcmp.c (do_random_tests): Test whether return value
has been promoted to wordsize if the ABI requires caller to do so.
	* string/test-strncmp.c (do_random_tests): Likewise.
	* string/test-memcmp.c (do_random_tests): Likewise.

	* sysdeps/powerpc/powerpc64/strcmp.S (strcmp): Sign extend rRTN
	before returning.
2003-04-11 22:11:44 +00:00
Roland McGrath 58ef9ef7bc * string/test-string.h: New file.
* string/test-strlen.c: New file.
	* string/test-string.h: New file.
	* string/test-strcmp.c: New file.
	* string/test-strchr.c: New file.
	* string/test-strrchr.c: New file.
	* string/test-strcpy.c: New file.
	* string/test-stpcpy.c: New file.
	* string/test-strncpy.c: New file.
	* string/test-stpncpy.c: New file.
	* string/test-strpbrk.c: New file.
	* string/test-strcspn.c: New file.
	* string/test-strspn.c: New file.
	* string/test-strcat.c: New file.
	* string/test-strncmp.c: New file.
	* string/test-memchr.c: New file.
	* string/test-memcmp.c: New file.
	* string/test-memset.c: New file.
	* string/test-memcpy.c: New file.
	* string/test-mempcpy.c: New file.
	* string/test-memmove.c: New file.
	* string/Makefile (strop-tests): New variable.
	(tests): Add strop-tests.
	(distribute): Add test-string.h.
2002-11-07 19:15:01 +00:00