public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] String: Improve test coverage for memchr
@ 2022-10-10 16:48 Sunil K Pandey
  2022-10-10 16:52 ` H.J. Lu
  0 siblings, 1 reply; 4+ messages in thread
From: Sunil K Pandey @ 2022-10-10 16:48 UTC (permalink / raw)
  To: libc-alpha

This test improves memchr coverage near page boundary.
---
 string/test-memchr.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/string/test-memchr.c b/string/test-memchr.c
index 279a67ebe6..1cbcd57fd4 100644
--- a/string/test-memchr.c
+++ b/string/test-memchr.c
@@ -247,8 +247,11 @@ test_main (void)
   /* BZ#21182 - wrong overflow calculation for i686 implementation
      with address near end of the page.  */
   for (i = 2; i < 16; ++i)
-    /* page_size is in fact getpagesize() * 2.  */
-    do_test (page_size / 2 - i, i, i, 1, 0x9B);
+    {
+      /* page_size is in fact getpagesize() * 2.  */
+      do_test (page_size / 2 - i, i, i, 1, 0x9B);
+      do_test (page_size / 2 - i, i - 1, i - 1, 1, 0x9B);
+    }
 
   do_random_tests ();
   do_overflow_tests ();
-- 
2.36.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] String: Improve test coverage for memchr
  2022-10-10 16:48 [PATCH] String: Improve test coverage for memchr Sunil K Pandey
@ 2022-10-10 16:52 ` H.J. Lu
  0 siblings, 0 replies; 4+ messages in thread
From: H.J. Lu @ 2022-10-10 16:52 UTC (permalink / raw)
  To: Sunil K Pandey; +Cc: libc-alpha

On Mon, Oct 10, 2022 at 9:49 AM Sunil K Pandey via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> This test improves memchr coverage near page boundary.
> ---
>  string/test-memchr.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/string/test-memchr.c b/string/test-memchr.c
> index 279a67ebe6..1cbcd57fd4 100644
> --- a/string/test-memchr.c
> +++ b/string/test-memchr.c
> @@ -247,8 +247,11 @@ test_main (void)
>    /* BZ#21182 - wrong overflow calculation for i686 implementation
>       with address near end of the page.  */
>    for (i = 2; i < 16; ++i)
> -    /* page_size is in fact getpagesize() * 2.  */
> -    do_test (page_size / 2 - i, i, i, 1, 0x9B);
> +    {
> +      /* page_size is in fact getpagesize() * 2.  */
> +      do_test (page_size / 2 - i, i, i, 1, 0x9B);
> +      do_test (page_size / 2 - i, i - 1, i - 1, 1, 0x9B);
> +    }
>
>    do_random_tests ();
>    do_overflow_tests ();
> --
> 2.36.1
>

LGTM.

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] String: Improve test coverage for memchr
  2022-10-18  7:44 ` [PATCH] String: Improve test coverage for memchr Sunil K Pandey
@ 2022-10-18 15:44   ` H.J. Lu
  0 siblings, 0 replies; 4+ messages in thread
From: H.J. Lu @ 2022-10-18 15:44 UTC (permalink / raw)
  To: Sunil K Pandey; +Cc: libc-alpha

On Tue, Oct 18, 2022 at 12:44 AM Sunil K Pandey via Libc-alpha
<libc-alpha@sourceware.org> wrote:
>
> This test improves memchr coverage near page boundary.
> ---
>  string/test-memchr.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/string/test-memchr.c b/string/test-memchr.c
> index 1cbcd57fd4..ab206e05db 100644
> --- a/string/test-memchr.c
> +++ b/string/test-memchr.c
> @@ -251,6 +251,7 @@ test_main (void)
>        /* page_size is in fact getpagesize() * 2.  */
>        do_test (page_size / 2 - i, i, i, 1, 0x9B);
>        do_test (page_size / 2 - i, i - 1, i - 1, 1, 0x9B);
> +      do_test (page_size / 2 - (i * 4), i + 128, i + 128, i, 0x9B);
>      }
>
>    do_random_tests ();
> --
> 2.36.1
>

LGTM.

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] String: Improve test coverage for memchr
  2022-10-18  6:30 [PATCH v5] x86_64: Implement evex512 version of memchr, rawmemchr and wmemchr Noah Goldstein
@ 2022-10-18  7:44 ` Sunil K Pandey
  2022-10-18 15:44   ` H.J. Lu
  0 siblings, 1 reply; 4+ messages in thread
From: Sunil K Pandey @ 2022-10-18  7:44 UTC (permalink / raw)
  To: libc-alpha

This test improves memchr coverage near page boundary.
---
 string/test-memchr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/string/test-memchr.c b/string/test-memchr.c
index 1cbcd57fd4..ab206e05db 100644
--- a/string/test-memchr.c
+++ b/string/test-memchr.c
@@ -251,6 +251,7 @@ test_main (void)
       /* page_size is in fact getpagesize() * 2.  */
       do_test (page_size / 2 - i, i, i, 1, 0x9B);
       do_test (page_size / 2 - i, i - 1, i - 1, 1, 0x9B);
+      do_test (page_size / 2 - (i * 4), i + 128, i + 128, i, 0x9B);
     }
 
   do_random_tests ();
-- 
2.36.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-18 15:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-10 16:48 [PATCH] String: Improve test coverage for memchr Sunil K Pandey
2022-10-10 16:52 ` H.J. Lu
2022-10-18  6:30 [PATCH v5] x86_64: Implement evex512 version of memchr, rawmemchr and wmemchr Noah Goldstein
2022-10-18  7:44 ` [PATCH] String: Improve test coverage for memchr Sunil K Pandey
2022-10-18 15:44   ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).