From cd2dd3df15523e2be8d2bbace27641d6ac9fa40d Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 22 Feb 2015 22:43:40 +0000 Subject: Import compiler-rt trunk r230183. https://llvm.org/svn/llvm-project/compiler-rt/trunk@230183 --- test/msan/mmap_below_shadow.cc | 5 +++++ test/msan/strlen_of_shadow.cc | 4 ++++ test/msan/vector_select.cc | 8 ++++++++ 3 files changed, 17 insertions(+) (limited to 'test/msan') 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 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 __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 -- cgit v1.2.3