From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7844) id C36F7385E452; Fri, 25 Mar 2022 18:19:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C36F7385E452 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Noah Goldstein To: glibc-cvs@sourceware.org Subject: [glibc] string: Expand page cross test cases in test-strcmp.c X-Act-Checkin: glibc X-Git-Author: Noah Goldstein X-Git-Refname: refs/heads/master X-Git-Oldrev: d154758e618ec9324f5d339c46db0aa27e8b1226 X-Git-Newrev: 22833848e3a2ef3bebef088cea7fcf281972672a Message-Id: <20220325181912.C36F7385E452@sourceware.org> Date: Fri, 25 Mar 2022 18:19:12 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Mar 2022 18:19:12 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=22833848e3a2ef3bebef088cea7fcf281972672a commit 22833848e3a2ef3bebef088cea7fcf281972672a Author: Noah Goldstein Date: Wed Mar 23 16:57:39 2022 -0500 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 Diff: --- string/test-strcmp.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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;