mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Clear destination buffer updated by the previous run
Clear the destination buffer updated by the previous run in bench-memcpy.c and test-memcpy.c to catch the error when the following implementations do not copy anything. [BZ #19907] * benchtests/bench-memcpy.c (do_one_test): Clear the destination buffer updated by the previous run. * string/test-memcpy.c (do_one_test): Likewise. * benchtests/bench-memmove.c (do_one_test): Add a comment. * string/test-memmove.c (do_one_test): Likewise.
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
2016-05-18 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
[BZ #19907]
|
||||||
|
* benchtests/bench-memcpy.c (do_one_test): Clear the destination
|
||||||
|
buffer updated by the previous run.
|
||||||
|
* string/test-memcpy.c (do_one_test): Likewise.
|
||||||
|
* benchtests/bench-memmove.c (do_one_test): Add a comment.
|
||||||
|
* string/test-memmove.c (do_one_test): Likewise.
|
||||||
|
|
||||||
2016-05-17 Joseph Myers <joseph@codesourcery.com>
|
2016-05-17 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
[BZ #20094]
|
[BZ #20094]
|
||||||
|
@ -55,6 +55,10 @@ do_one_test (impl_t *impl, char *dst, const char *src,
|
|||||||
size_t i, iters = INNER_LOOP_ITERS;
|
size_t i, iters = INNER_LOOP_ITERS;
|
||||||
timing_t start, stop, cur;
|
timing_t start, stop, cur;
|
||||||
|
|
||||||
|
/* Must clear the destination buffer set by the previous run. */
|
||||||
|
for (i = 0; i < len; i++)
|
||||||
|
dst[i] = 0;
|
||||||
|
|
||||||
if (CALL (impl, dst, src, len) != MEMCPY_RESULT (dst, len))
|
if (CALL (impl, dst, src, len) != MEMCPY_RESULT (dst, len))
|
||||||
{
|
{
|
||||||
error (0, 0, "Wrong result in function %s %p %p", impl->name,
|
error (0, 0, "Wrong result in function %s %p %p", impl->name,
|
||||||
|
@ -70,6 +70,7 @@ do_one_test (impl_t *impl, char *dst, char *src, const char *orig_src,
|
|||||||
size_t i, iters = INNER_LOOP_ITERS;
|
size_t i, iters = INNER_LOOP_ITERS;
|
||||||
timing_t start, stop, cur;
|
timing_t start, stop, cur;
|
||||||
|
|
||||||
|
/* This also clears the destination buffer set by the previous run. */
|
||||||
memcpy (src, orig_src, len);
|
memcpy (src, orig_src, len);
|
||||||
#ifdef TEST_BCOPY
|
#ifdef TEST_BCOPY
|
||||||
CALL (impl, src, dst, len);
|
CALL (impl, src, dst, len);
|
||||||
|
@ -53,6 +53,12 @@ static void
|
|||||||
do_one_test (impl_t *impl, char *dst, const char *src,
|
do_one_test (impl_t *impl, char *dst, const char *src,
|
||||||
size_t len)
|
size_t len)
|
||||||
{
|
{
|
||||||
|
size_t i;
|
||||||
|
|
||||||
|
/* Must clear the destination buffer set by the previous run. */
|
||||||
|
for (i = 0; i < len; i++)
|
||||||
|
dst[i] = 0;
|
||||||
|
|
||||||
if (CALL (impl, dst, src, len) != MEMCPY_RESULT (dst, len))
|
if (CALL (impl, dst, src, len) != MEMCPY_RESULT (dst, len))
|
||||||
{
|
{
|
||||||
error (0, 0, "Wrong result in function %s %p %p", impl->name,
|
error (0, 0, "Wrong result in function %s %p %p", impl->name,
|
||||||
|
@ -68,6 +68,7 @@ static void
|
|||||||
do_one_test (impl_t *impl, char *dst, char *src, const char *orig_src,
|
do_one_test (impl_t *impl, char *dst, char *src, const char *orig_src,
|
||||||
size_t len)
|
size_t len)
|
||||||
{
|
{
|
||||||
|
/* This also clears the destination buffer set by the previous run. */
|
||||||
memcpy (src, orig_src, len);
|
memcpy (src, orig_src, len);
|
||||||
#ifdef TEST_BCOPY
|
#ifdef TEST_BCOPY
|
||||||
CALL (impl, src, dst, len);
|
CALL (impl, src, dst, len);
|
||||||
|
Reference in New Issue
Block a user