Add a strstr test for page boundary

This commit is contained in:
H.J. Lu 2012-10-06 16:04:56 -07:00
parent f076216468
commit 5d41d91a3e
2 changed files with 10 additions and 1 deletions

View file

@ -1,3 +1,7 @@
2012-10-06 H.J. Lu <hongjiu.lu@intel.com>
* string/test-strstr.c (check2): Add a test for page boundary.
2012-10-05 David S. Miller <davem@davemloft.net>
* sysdeps/sparc/sparc64/multiarch/memset-niagara4.S: New file.

View file

@ -161,10 +161,15 @@ check2 (void)
{
const char s1[] = ", enable_static, \0, enable_shared, ";
char *exp_result;
char *s2 = (void *) buf1 + page_size - 18;
strcpy (s2, s1);
exp_result = stupid_strstr (s1, s1 + 18);
FOR_EACH_IMPL (impl, 0)
check_result (impl, s1, s1 + 18, exp_result);
{
check_result (impl, s1, s1 + 18, exp_result);
check_result (impl, s2, s1 + 18, exp_result);
}
}
static int