summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/asan/TestCases/Linux/clang_gcc_abi.cc2
-rw-r--r--test/asan/lit.cfg5
-rw-r--r--test/lsan/TestCases/large_allocation_leak.cc2
-rw-r--r--test/lsan/TestCases/swapcontext.cc8
-rw-r--r--test/lsan/TestCases/use_registers.cc5
-rw-r--r--test/lsan/TestCases/use_tls_dynamic.cc2
-rw-r--r--test/lsan/lit.common.cfg7
-rw-r--r--test/sanitizer_common/print_address.h2
8 files changed, 25 insertions, 8 deletions
diff --git a/test/asan/TestCases/Linux/clang_gcc_abi.cc b/test/asan/TestCases/Linux/clang_gcc_abi.cc
index 845f4121a..79710dc83 100644
--- a/test/asan/TestCases/Linux/clang_gcc_abi.cc
+++ b/test/asan/TestCases/Linux/clang_gcc_abi.cc
@@ -3,7 +3,7 @@
// RUN: %clangxx_asan -O2 -x c %s -o %t && not %run %t 2>&1 | FileCheck %s
// RUN: %clangxx_asan -O3 -x c %s -o %t && not %run %t 2>&1 | FileCheck %s
-// REQUIRES: arm-target-arch
+// REQUIRES: arm-target-arch, fast-unwinder-works
// XFAIL: armv7l-unknown-linux-gnueabihf
#include <stdlib.h>
diff --git a/test/asan/lit.cfg b/test/asan/lit.cfg
index 37ba10df6..9093b44c1 100644
--- a/test/asan/lit.cfg
+++ b/test/asan/lit.cfg
@@ -2,6 +2,7 @@
import os
import platform
+import re
import lit.formats
@@ -211,6 +212,10 @@ config.substitutions.append( ("%xdynamiclib_namespec", '%basename_t.dynamic') )
if config.target_arch != 'arm' and config.target_arch != 'armhf' and config.target_arch != 'aarch64':
config.available_features.add('stable-runtime')
+# Fast unwinder doesn't work with Thumb
+if not re.match('-mthumb', config.target_cflags):
+ config.available_features.add('fast-unwinder-works')
+
# Turn on leak detection on 64-bit Linux.
if config.host_os == 'Linux' and (config.target_arch == 'x86_64' or config.target_arch == 'i386'):
config.available_features.add('leak-detection')
diff --git a/test/lsan/TestCases/large_allocation_leak.cc b/test/lsan/TestCases/large_allocation_leak.cc
index 7254f9cbe..c3da932a4 100644
--- a/test/lsan/TestCases/large_allocation_leak.cc
+++ b/test/lsan/TestCases/large_allocation_leak.cc
@@ -5,7 +5,7 @@
// For 32 bit LSan it's pretty likely that large chunks are "reachable" from some
// internal data structures (e.g. Glibc global data).
-// UNSUPPORTED: x86
+// UNSUPPORTED: x86, arm
#include <stdio.h>
#include <stdlib.h>
diff --git a/test/lsan/TestCases/swapcontext.cc b/test/lsan/TestCases/swapcontext.cc
index f7e95ed2c..f990526cf 100644
--- a/test/lsan/TestCases/swapcontext.cc
+++ b/test/lsan/TestCases/swapcontext.cc
@@ -2,8 +2,10 @@
// memory. Make sure we don't report these leaks.
// RUN: %clangxx_lsan %s -o %t
-// RUN: %run %t 2>&1
-// RUN: not %run %t foo 2>&1 | FileCheck %s
+// RUN: LSAN_BASE="detect_leaks=1"
+// RUN: LSAN_OPTIONS=$LSAN_BASE %run %t 2>&1
+// RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t foo 2>&1 | FileCheck %s
+// UNSUPPORTED: arm
#include <stdio.h>
#if defined(__APPLE__)
@@ -23,7 +25,7 @@ void Child() {
}
int main(int argc, char *argv[]) {
- char stack_memory[kStackSize + 1];
+ char stack_memory[kStackSize + 1] __attribute__((aligned(16)));
char *heap_memory = new char[kStackSize + 1];
char *child_stack = (argc > 1) ? stack_memory : heap_memory;
diff --git a/test/lsan/TestCases/use_registers.cc b/test/lsan/TestCases/use_registers.cc
index 789687401..2fe13318e 100644
--- a/test/lsan/TestCases/use_registers.cc
+++ b/test/lsan/TestCases/use_registers.cc
@@ -33,6 +33,11 @@ void *registers_thread_func(void *arg) {
:
: "r" (p)
);
+#elif defined(__arm__)
+ asm ( "mov r5, %0"
+ :
+ : "r" (p)
+ );
#else
#error "Test is not supported on this architecture."
#endif
diff --git a/test/lsan/TestCases/use_tls_dynamic.cc b/test/lsan/TestCases/use_tls_dynamic.cc
index c20232dc3..6af82d59e 100644
--- a/test/lsan/TestCases/use_tls_dynamic.cc
+++ b/test/lsan/TestCases/use_tls_dynamic.cc
@@ -5,7 +5,7 @@
// RUN: LSAN_OPTIONS=$LSAN_BASE:"use_tls=0" not %run %t 2>&1 | FileCheck %s
// RUN: LSAN_OPTIONS=$LSAN_BASE:"use_tls=1" %run %t 2>&1
// RUN: LSAN_OPTIONS="" %run %t 2>&1
-// UNSUPPORTED: i386-linux,i686-linux
+// UNSUPPORTED: i386-linux,i686-linux,arm
#ifndef BUILD_DSO
#include <assert.h>
diff --git a/test/lsan/lit.common.cfg b/test/lsan/lit.common.cfg
index 8580eec33..f47d76e6d 100644
--- a/test/lsan/lit.common.cfg
+++ b/test/lsan/lit.common.cfg
@@ -3,6 +3,7 @@
# Common configuration for running leak detection tests under LSan/ASan.
import os
+import re
import lit.util
@@ -52,7 +53,11 @@ config.substitutions.append( ("%clang_lsan ", build_invocation(clang_lsan_cflags
config.substitutions.append( ("%clangxx_lsan ", build_invocation(clang_lsan_cxxflags)) )
# LeakSanitizer tests are currently supported on x86-64 Linux and mips64 Linux only.
-if config.host_os not in ['Linux'] or config.host_arch not in ['x86_64', 'mips64']:
+if config.host_os not in ['Linux'] or config.host_arch not in ['x86_64', 'mips64', 'arm', 'armhf']:
+ config.unsupported = True
+
+# Don't support Thumb due to broken fast unwinder
+if re.match('-mthumb', config.target_cflags):
config.unsupported = True
config.suffixes = ['.c', '.cc', '.cpp']
diff --git a/test/sanitizer_common/print_address.h b/test/sanitizer_common/print_address.h
index 99261b331..63d9a93f1 100644
--- a/test/sanitizer_common/print_address.h
+++ b/test/sanitizer_common/print_address.h
@@ -11,7 +11,7 @@ void print_address(const char *str, int n, ...) {
// On FreeBSD, the %p conversion specifier works as 0x%x and thus does not
// match to the format used in the diagnotic message.
fprintf(stderr, "0x%012lx ", (unsigned long) p);
-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__arm__)
fprintf(stderr, "0x%8lx ", (unsigned long) p);
#elif defined(__mips64)
fprintf(stderr, "0x%010lx ", (unsigned long) p);