aboutsummaryrefslogtreecommitdiff
path: root/benchtests/bench-memchr.c
diff options
context:
space:
mode:
authorNoah Goldstein <goldstein.w.n@gmail.com>2021-05-03 04:44:35 -0400
committerH.J. Lu <hjl.tools@gmail.com>2021-05-03 10:18:11 -0700
commit1427d28e3008e2d2d467883a14a24df6a40b82b1 (patch)
tree997fde9610919d026d11c98fa2164f64fd24030f /benchtests/bench-memchr.c
parent7b414d6e7bd517080bf5b338b979a0ee065a6801 (diff)
downloadglibc-1427d28e3008e2d2d467883a14a24df6a40b82b1.zip
glibc-1427d28e3008e2d2d467883a14a24df6a40b82b1.tar.gz
glibc-1427d28e3008e2d2d467883a14a24df6a40b82b1.tar.bz2
Bench: Expand bench-memchr.c
No bug. This commit adds some additional cases for bench-memchr.c including testing medium sizes and testing short length with both an inbound match and out of bound match. Signed-off-by: Noah Goldstein <goldstein.w.n@gmail.com>
Diffstat (limited to 'benchtests/bench-memchr.c')
-rw-r--r--benchtests/bench-memchr.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/benchtests/bench-memchr.c b/benchtests/bench-memchr.c
index f5ced9d..5573f93 100644
--- a/benchtests/bench-memchr.c
+++ b/benchtests/bench-memchr.c
@@ -135,12 +135,25 @@ test_main (void)
do_test (i, i, 256, 0);
#endif
}
+ for (i = 1; i < 8; ++i)
+ {
+ do_test (i, i << 5, 192, 23);
+ do_test (i, i << 5, 192, 0);
+ do_test (i, i << 5, 256, 23);
+ do_test (i, i << 5, 256, 0);
+ do_test (i, i << 5, 512, 23);
+ do_test (i, i << 5, 512, 0);
+ }
for (i = 1; i < 32; ++i)
{
do_test (0, i, i + 1, 23);
do_test (0, i, i + 1, 0);
do_test (i, i, i + 1, 23);
do_test (i, i, i + 1, 0);
+ do_test (0, i, i - 1, 23);
+ do_test (0, i, i - 1, 0);
+ do_test (i, i, i - 1, 23);
+ do_test (i, i, i - 1, 0);
#ifdef USE_AS_MEMRCHR
/* Also test the position close to the beginning for memrchr. */
do_test (0, 1, i + 1, 23);