[PATCH] [MSan][MIPS] Fix for some failing tests on MIPS64

Mohit Bhakkad mohit.bhakkad at imgtec.com
Mon Feb 2 01:43:31 PST 2015


Hi eugenis, kcc, samsonov,

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7332

Files:
  lib/msan/tests/msan_test.cc
  test/msan/mmap_below_shadow.cc
  test/msan/strlen_of_shadow.cc
  test/msan/vector_cvt.cc
  test/msan/vector_select.cc

Index: lib/msan/tests/msan_test.cc
===================================================================
--- lib/msan/tests/msan_test.cc
+++ lib/msan/tests/msan_test.cc
@@ -2800,7 +2800,13 @@
 // Compute the path to our loadable DSO.  We assume it's in the same
 // directory.  Only use string routines that we intercept so far to do this.
 static int PathToLoadable(char *buf, size_t sz) {
+#if defined(__x86_64__)
   const char *basename = "libmsan_loadable.x86_64.so";
+#elif defined(__MIPSEB__) || defined(MIPSEB)
+  const char *basename = "libmsan_loadable.mips64.so";
+#elif defined(__mips64)
+  const char *basename = "libmsan_loadable.mips64el.so";
+#endif
   char *argv0 = program_invocation_name;
   char *last_slash = strrchr(argv0, '/');
   assert(last_slash);
@@ -2856,7 +2862,13 @@
 
 // Regression test for a crash in dlopen() interceptor.
 TEST(MemorySanitizer, dlopenFailed) {
+#if defined(__x86_64__)
   const char *path = "/libmsan_loadable_does_not_exist.x86_64.so";
+#elif defined(__MIPSEB__) || defined(MIPSEB)
+  const char *path = "/libmsan_loadable_does_not_exist.mips64.so";
+#elif defined(__mips64)
+  const char *path = "/libmsan_loadable_does_not_exist.mips64el.so";
+#endif
   void *lib = dlopen(path, RTLD_LAZY);
   ASSERT_TRUE(lib == NULL);
 }
Index: test/msan/mmap_below_shadow.cc
===================================================================
--- test/msan/mmap_below_shadow.cc
+++ test/msan/mmap_below_shadow.cc
@@ -15,8 +15,13 @@
 
 int main(void) {
   // Hint address just below shadow.
+#if defined (__mips64)
+  uintptr_t hint = 0x4f00000000ULL;
+  const uintptr_t app_start = 0x6000000000ULL;
+#elif defined(__x86_64__)
   uintptr_t hint = 0x4f0000000000ULL;
   const uintptr_t app_start = 0x600000000000ULL;
+#endif
   uintptr_t p = (uintptr_t)mmap(
       (void *)hint, 4096, PROT_WRITE,
       MAP_PRIVATE | MAP_ANONYMOUS | (FIXED ? MAP_FIXED : 0), -1, 0);
Index: test/msan/strlen_of_shadow.cc
===================================================================
--- test/msan/strlen_of_shadow.cc
+++ test/msan/strlen_of_shadow.cc
@@ -9,7 +9,11 @@
 #include <string.h>
 
 const char *mem_to_shadow(const char *p) {
+#if defined (__mips64)
+  return (char *)((uintptr_t)p & ~0x4000000000ULL);
+#elif defined(__x86_64__)
   return (char *)((uintptr_t)p & ~0x400000000000ULL);
+#endif
 }
 
 int main(void) {
Index: test/msan/vector_cvt.cc
===================================================================
--- test/msan/vector_cvt.cc
+++ test/msan/vector_cvt.cc
@@ -1,5 +1,7 @@
 // RUN: %clangxx_msan -m64 -O0 %s -o %t && %run %t
 // RUN: %clangxx_msan -DPOSITIVE -m64 -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
+// XFAIL: mips64
+// XFAIL: mips64el
 
 #include <emmintrin.h>
 
Index: test/msan/vector_select.cc
===================================================================
--- test/msan/vector_select.cc
+++ test/msan/vector_select.cc
@@ -1,6 +1,7 @@
 // RUN: %clangxx_msan -m64 -O0 %s -c -o %t
 // RUN: %clangxx_msan -m64 -O3 %s -c -o %t
-
+// XFAIL: mips64
+// XFAIL: mips64el
 // Regression test for MemorySanitizer instrumentation of a select instruction
 // with vector arguments.

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7332.19135.patch
Type: text/x-patch
Size: 3143 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150202/acaa6602/attachment.bin>


More information about the llvm-commits mailing list