about summary refs log tree commit diff
path: root/string
diff options
context:
space:
mode:
authorNoah Goldstein <goldstein.w.n@gmail.com>2022-03-23 16:57:39 -0500
committerNoah Goldstein <goldstein.w.n@gmail.com>2022-03-25 11:46:13 -0500
commit22833848e3a2ef3bebef088cea7fcf281972672a (patch)
tree9583c65bca6e680c793e967eac7d31661837e724 /string
parentd154758e618ec9324f5d339c46db0aa27e8b1226 (diff)
downloadglibc-22833848e3a2ef3bebef088cea7fcf281972672a.tar.gz
glibc-22833848e3a2ef3bebef088cea7fcf281972672a.tar.xz
glibc-22833848e3a2ef3bebef088cea7fcf281972672a.zip
string: Expand page cross test cases in test-strcmp.c
Test cases for when both `s1` and `s2` are near the end of a page
where previously missing.
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
Diffstat (limited to 'string')
-rw-r--r--string/test-strcmp.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/string/test-strcmp.c b/string/test-strcmp.c
index 0abce769d0..ece03c6d0b 100644
--- a/string/test-strcmp.c
+++ b/string/test-strcmp.c
@@ -392,7 +392,7 @@ check3 (void)
 int
 test_main (void)
 {
-  size_t i, j;
+  size_t i, j, k;
   const size_t test_len = MIN(TEST_LEN, 3 * 4096);
   test_init ();
   check();
@@ -453,6 +453,19 @@ test_main (void)
           do_test (j, getpagesize () - j - 1, i, 127, 1);
           do_test (j, getpagesize () - j - 1, i, 127, -1);
 
+          for (k = 2; k <= 128; k += k)
+            {
+              do_test (getpagesize () - k, getpagesize () - j - 1, i, 127, 0);
+              do_test (getpagesize () - k - 1, getpagesize () - j - 1, i, 127,
+                       0);
+              do_test (getpagesize () - k, getpagesize () - j - 1, i, 127, 1);
+              do_test (getpagesize () - k - 1, getpagesize () - j - 1, i, 127,
+                       1);
+              do_test (getpagesize () - k, getpagesize () - j - 1, i, 127, -1);
+              do_test (getpagesize () - k - 1, getpagesize () - j - 1, i, 127,
+                       -1);
+            }
+
           if (i < 32)
             {
               i += 1;