aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2022-02-17 08:10:35 -0800
committerAndreas K. Hüttel <dilfridge@gentoo.org>2022-02-17 21:41:03 +0100
commitd9cf0ba7b5c317e3096d10c0a254e74ae4276910 (patch)
tree302dec9117d6b26db055986ecc46febae20f8d26
parent<bits/platform/x86.h>: Correct x86_cpu_TBM (diff)
downloadglibc-gentoo/2.33.tar.gz
glibc-gentoo/2.33.tar.bz2
glibc-gentoo/2.33.zip
string: Add a testcase for wcsncmp with SIZE_MAX [BZ #28755]gentoo/2.33
Verify that wcsncmp (L("abc"), L("abd"), SIZE_MAX) == 0. The new test fails without commit ddf0992cf57a93200e0c782e2a94d0733a5a0b87 Author: Noah Goldstein <goldstein.w.n@gmail.com> Date: Sun Jan 9 16:02:21 2022 -0600 x86: Fix __wcsncmp_avx2 in strcmp-avx2.S [BZ# 28755] and commit 7e08db3359c86c94918feb33a1182cd0ff3bb10b Author: Noah Goldstein <goldstein.w.n@gmail.com> Date: Sun Jan 9 16:02:28 2022 -0600 x86: Fix __wcsncmp_evex in strcmp-evex.S [BZ# 28755] This is for BZ #28755. Reviewed-by: Sunil K Pandey <skpgkp2@gmail.com> (cherry picked from commit aa5a720056d37cf24924c138a3dbe6dace98e97c) (cherry picked from commit cb922428dc7c5260ea84de482ffe05d2ea766199)
-rw-r--r--string/test-strncmp.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/string/test-strncmp.c b/string/test-strncmp.c
index 10b34de8d2..97e831d88f 100644
--- a/string/test-strncmp.c
+++ b/string/test-strncmp.c
@@ -435,6 +435,18 @@ check3 (void)
}
}
+static void
+check4 (void)
+{
+ const CHAR *s1 = L ("abc");
+ CHAR *s2 = STRDUP (s1);
+
+ FOR_EACH_IMPL (impl, 0)
+ check_result (impl, s1, s2, SIZE_MAX, 0);
+
+ free (s2);
+}
+
int
test_main (void)
{
@@ -445,6 +457,7 @@ test_main (void)
check1 ();
check2 ();
check3 ();
+ check4 ();
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)