summaryrefslogtreecommitdiff
path: root/test/msan
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-02-22 22:43:40 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-02-22 22:43:40 +0000
commitcd2dd3df15523e2be8d2bbace27641d6ac9fa40d (patch)
treefbdacaec253cc5ceee88cb44de5545fa32c8bd67 /test/msan
parent476c4db3dc56bee43df384704c75ccc71cfa7a1d (diff)
downloadsrc-test2-cd2dd3df15523e2be8d2bbace27641d6ac9fa40d.tar.gz
src-test2-cd2dd3df15523e2be8d2bbace27641d6ac9fa40d.zip
Notes
Diffstat (limited to 'test/msan')
-rw-r--r--test/msan/mmap_below_shadow.cc5
-rw-r--r--test/msan/strlen_of_shadow.cc4
-rw-r--r--test/msan/vector_select.cc8
3 files changed, 17 insertions, 0 deletions
diff --git a/test/msan/mmap_below_shadow.cc b/test/msan/mmap_below_shadow.cc
index 4b5890ba0fb8..0b982d58930d 100644
--- a/test/msan/mmap_below_shadow.cc
+++ b/test/msan/mmap_below_shadow.cc
@@ -15,8 +15,13 @@
int main(void) {
// Hint address just below shadow.
+#if defined(__x86_64__)
uintptr_t hint = 0x4f0000000000ULL;
const uintptr_t app_start = 0x600000000000ULL;
+#elif defined (__mips64)
+ uintptr_t hint = 0x4f00000000ULL;
+ const uintptr_t app_start = 0x6000000000ULL;
+#endif
uintptr_t p = (uintptr_t)mmap(
(void *)hint, 4096, PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS | (FIXED ? MAP_FIXED : 0), -1, 0);
diff --git a/test/msan/strlen_of_shadow.cc b/test/msan/strlen_of_shadow.cc
index bb9fe17d41cd..8f1b4e1fc6bb 100644
--- a/test/msan/strlen_of_shadow.cc
+++ b/test/msan/strlen_of_shadow.cc
@@ -9,7 +9,11 @@
#include <string.h>
const char *mem_to_shadow(const char *p) {
+#if defined(__x86_64__)
return (char *)((uintptr_t)p & ~0x400000000000ULL);
+#elif defined (__mips64)
+ return (char *)((uintptr_t)p & ~0x4000000000ULL);
+#endif
}
int main(void) {
diff --git a/test/msan/vector_select.cc b/test/msan/vector_select.cc
index e8d55423293c..afeb1ad50c8b 100644
--- a/test/msan/vector_select.cc
+++ b/test/msan/vector_select.cc
@@ -4,10 +4,18 @@
// Regression test for MemorySanitizer instrumentation of a select instruction
// with vector arguments.
+#if defined(__x86_64__)
#include <emmintrin.h>
__m128d select(bool b, __m128d c, __m128d d)
{
return b ? c : d;
}
+#elif defined (__mips64)
+typedef double __w64d __attribute__ ((vector_size(16)));
+__w64d select(bool b, __w64d c, __w64d d)
+{
+ return b ? c : d;
+}
+#endif