summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/test')
-rw-r--r--compiler-rt/test/msan/chained_origin_limits.cc4
-rw-r--r--compiler-rt/test/msan/mmap.cc32
-rw-r--r--compiler-rt/test/msan/strlen_of_shadow.cc16
3 files changed, 22 insertions, 30 deletions
diff --git a/compiler-rt/test/msan/chained_origin_limits.cc b/compiler-rt/test/msan/chained_origin_limits.cc
index 889d4ea8531..90fd09a86b2 100644
--- a/compiler-rt/test/msan/chained_origin_limits.cc
+++ b/compiler-rt/test/msan/chained_origin_limits.cc
@@ -61,10 +61,6 @@
// RUN: MSAN_OPTIONS=origin_history_size=7,origin_history_per_stack_limit=0 not %run %t >%t.out 2>&1
// RUN: FileCheck %s --check-prefix=CHECK7 < %t.out
-//
-// AArch64 fails with -fsanitize-memory-track-origins=2 with and invalid access
-// on 'return buf[50]'.
-// XFAIL: aarch64
#include <stdio.h>
#include <stdlib.h>
diff --git a/compiler-rt/test/msan/mmap.cc b/compiler-rt/test/msan/mmap.cc
index 962836cd65f..27a8bb2d6eb 100644
--- a/compiler-rt/test/msan/mmap.cc
+++ b/compiler-rt/test/msan/mmap.cc
@@ -23,17 +23,27 @@ bool AddrIsApp(void *p) {
#elif defined(__powerpc64__)
return addr < 0x000100000000ULL || addr >= 0x300000000000ULL;
#elif defined(__aarch64__)
- unsigned long vma = SystemVMA();
- if (vma == 39)
- return (addr >= 0x5500000000ULL && addr < 0x5600000000ULL) ||
- (addr > 0x7000000000ULL);
- else if (vma == 42)
- return (addr >= 0x2aa00000000ULL && addr < 0x2ab00000000ULL) ||
- (addr > 0x3f000000000ULL);
- else {
- fprintf(stderr, "unsupported vma: %lu\n", vma);
- exit(1);
- }
+
+ struct AddrMapping {
+ uintptr_t start;
+ uintptr_t end;
+ } mappings[] = {
+ {0x05000000000ULL, 0x06000000000ULL},
+ {0x07000000000ULL, 0x08000000000ULL},
+ {0x0F000000000ULL, 0x10000000000ULL},
+ {0x11000000000ULL, 0x12000000000ULL},
+ {0x20000000000ULL, 0x21000000000ULL},
+ {0x2A000000000ULL, 0x2B000000000ULL},
+ {0x2E000000000ULL, 0x2F000000000ULL},
+ {0x3B000000000ULL, 0x3C000000000ULL},
+ {0x3F000000000ULL, 0x40000000000ULL},
+ };
+ const size_t mappingsSize = sizeof (mappings) / sizeof (mappings[0]);
+
+ for (int i=0; i<mappingsSize; ++i)
+ if (addr >= mappings[i].start && addr < mappings[i].end)
+ return true;
+ return false;
#endif
}
diff --git a/compiler-rt/test/msan/strlen_of_shadow.cc b/compiler-rt/test/msan/strlen_of_shadow.cc
index 0594f00945b..3066dd5b61a 100644
--- a/compiler-rt/test/msan/strlen_of_shadow.cc
+++ b/compiler-rt/test/msan/strlen_of_shadow.cc
@@ -20,21 +20,7 @@ const char *mem_to_shadow(const char *p) {
(((uintptr_t)(mem) & ~0x200000000000ULL) ^ 0x100000000000ULL)
return (char *)(LINEARIZE_MEM(p) + 0x080000000000ULL);
#elif defined(__aarch64__)
- unsigned long vma = SystemVMA();
-
-#define LINEARIZE_MEM_39(mem) \
- (((uintptr_t)(mem) & ~0x7C00000000ULL) ^ 0x100000000ULL)
-#define LINEARIZE_MEM_42(mem) \
- (((uintptr_t)(mem) & ~0x3E000000000ULL) ^ 0x1000000000ULL)
-
- if (vma == 39)
- return (char *)(LINEARIZE_MEM_39(p) + 0x4000000000ULL);
- else if (vma == 42)
- return (char *)(LINEARIZE_MEM_42(p) + 0x10000000000ULL);
- else {
- fprintf(stderr, "unsupported vma: %lu\n", vma);
- exit(1);
- }
+ return (char *)((uintptr_t)p ^ 0x6000000000ULL);
#endif
}
OpenPOWER on IntegriCloud