summary refs log tree commit diff
path: root/benchtests
diff options
context:
space:
mode:
authorNoah Goldstein <goldstein.w.n@gmail.com>2021-04-19 17:48:11 -0400
committerH.J. Lu <hjl.tools@gmail.com>2021-04-19 15:08:04 -0700
commit81f6dd2135ea761832965bc7518e2ddf949480af (patch)
tree879feee7aef25bf4a8d160766ff98186c583cebd /benchtests
parentf53790272ce7bdc5ecd14b45f65d0464d2a61a3a (diff)
downloadglibc-81f6dd2135ea761832965bc7518e2ddf949480af.tar.gz
glibc-81f6dd2135ea761832965bc7518e2ddf949480af.tar.xz
glibc-81f6dd2135ea761832965bc7518e2ddf949480af.zip
x86: Expand test-memset.c and bench-memset.c
No bug. This commit adds tests cases and benchmarks for page cross and
for memset to the end of the page without crossing. As well in
test-memset.c this commit adds sentinel on start/end of tstbuf to test
for overwrites

Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
Diffstat (limited to 'benchtests')
-rw-r--r--benchtests/bench-memset.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/benchtests/bench-memset.c b/benchtests/bench-memset.c
index 1174900e88..d6619b4836 100644
--- a/benchtests/bench-memset.c
+++ b/benchtests/bench-memset.c
@@ -61,7 +61,7 @@ do_one_test (json_ctx_t *json_ctx, impl_t *impl, CHAR *s,
 static void
 do_test (json_ctx_t *json_ctx, size_t align, int c, size_t len)
 {
-  align &= 63;
+  align &= 4095;
   if ((align + len) * sizeof (CHAR) > page_size)
     return;
 
@@ -110,9 +110,11 @@ test_main (void)
     {
       for (i = 0; i < 18; ++i)
 	do_test (&json_ctx, 0, c, 1 << i);
-      for (i = 1; i < 32; ++i)
+      for (i = 1; i < 64; ++i)
 	{
 	  do_test (&json_ctx, i, c, i);
+	  do_test (&json_ctx, 4096 - i, c, i);
+	  do_test (&json_ctx, 4095, c, i);
 	  if (i & (i - 1))
 	    do_test (&json_ctx, 0, c, i);
 	}