summary refs log tree commit diff
path: root/string
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-08-02 17:46:58 -0700
committerDavid S. Miller <davem@davemloft.net>2016-08-02 17:46:58 -0700
commit5a0b6138d8325d6aabd504bcccd7ee5fba07bb25 (patch)
tree75981163d2a2ce019705cdd0f7f01cdae1316249 /string
parent30f926d3b3dcb74c038155715ed341d5c4b334eb (diff)
downloadglibc-5a0b6138d8325d6aabd504bcccd7ee5fba07bb25.tar.gz
glibc-5a0b6138d8325d6aabd504bcccd7ee5fba07bb25.tar.xz
glibc-5a0b6138d8325d6aabd504bcccd7ee5fba07bb25.zip
Fix wide-char testsuite SIGBUS on platforms such as Sparc.
	* string/test-strncmp.c (do_test_limit): Make sure the test data
	stream is aligned as required for the type "CHAR".
	(do_test): Likewise.
Diffstat (limited to 'string')
-rw-r--r--string/test-strncmp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/string/test-strncmp.c b/string/test-strncmp.c
index 8c0a331fc8..d3922483bb 100644
--- a/string/test-strncmp.c
+++ b/string/test-strncmp.c
@@ -156,6 +156,9 @@ do_test_limit (size_t align1, size_t align2, size_t len, size_t n, int max_char,
   size_t i, align_n;
   CHAR *s1, *s2;
 
+  align1 &= ~(CHARBYTES - 1);
+  align2 &= ~(CHARBYTES - 1);
+
   if (n == 0)
     {
       s1 = (CHAR *) (buf1 + page_size);
@@ -204,6 +207,9 @@ do_test (size_t align1, size_t align2, size_t len, size_t n, int max_char,
   size_t i;
   CHAR *s1, *s2;
 
+  align1 &= ~(CHARBYTES - 1);
+  align2 &= ~(CHARBYTES - 1);
+
   if (n == 0)
     return;