summaryrefslogtreecommitdiff
path: root/test/ubsan
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2017-10-06 20:51:51 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2017-10-06 20:51:51 +0000
commite9b56a34017060f38e481ae24a23acf43043fb4f (patch)
tree7119aa58b60a32fbdc9382574db96b44ce288d39 /test/ubsan
parentb3c632084941e7b9669416f91c7f90b7fcd49645 (diff)
[sanitizer] Test ubsan and cfi on android.
Summary: Enable check-cfi and check-ubsan on Android. Check-ubsan includes standalone and ubsan+asan, but not tsan or msan. Cross-dso cfi tests are disabled for now. Reviewers: vitalybuka, pcc Subscribers: srhines, kubamracek, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D38608 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315105 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ubsan')
-rw-r--r--test/ubsan/CMakeLists.txt2
-rw-r--r--test/ubsan/TestCases/Integer/suppressions.cpp1
-rw-r--r--test/ubsan/TestCases/TypeCheck/Function/lit.local.cfg2
-rw-r--r--test/ubsan/lit.common.cfg5
4 files changed, 7 insertions, 3 deletions
diff --git a/test/ubsan/CMakeLists.txt b/test/ubsan/CMakeLists.txt
index f4b73e87f..02088c35d 100644
--- a/test/ubsan/CMakeLists.txt
+++ b/test/ubsan/CMakeLists.txt
@@ -35,7 +35,7 @@ foreach(arch ${UBSAN_TEST_ARCH})
if(COMPILER_RT_HAS_MSAN AND ";${MSAN_SUPPORTED_ARCH};" MATCHES ";${arch};")
add_ubsan_testsuite("MemorySanitizer" msan ${arch})
endif()
- if(COMPILER_RT_HAS_TSAN AND ";${TSAN_SUPPORTED_ARCH};" MATCHES ";${arch};")
+ if(COMPILER_RT_HAS_TSAN AND ";${TSAN_SUPPORTED_ARCH};" MATCHES ";${arch};" AND NOT ANDROID)
add_ubsan_testsuite("ThreadSanitizer" tsan ${arch})
endif()
endforeach()
diff --git a/test/ubsan/TestCases/Integer/suppressions.cpp b/test/ubsan/TestCases/Integer/suppressions.cpp
index a9e660111..f72d82edf 100644
--- a/test/ubsan/TestCases/Integer/suppressions.cpp
+++ b/test/ubsan/TestCases/Integer/suppressions.cpp
@@ -3,6 +3,7 @@
// Suppression by symbol name (unsigned-integer-overflow:do_overflow below)
// requires the compiler-rt runtime to be able to symbolize stack addresses.
// REQUIRES: can-symbolize
+// UNSUPPORTED: android
// Fails without any suppression.
// RUN: %env_ubsan_opts=halt_on_error=1 not %run %t 2>&1 | FileCheck %s
diff --git a/test/ubsan/TestCases/TypeCheck/Function/lit.local.cfg b/test/ubsan/TestCases/TypeCheck/Function/lit.local.cfg
index 27c61a343..a10159995 100644
--- a/test/ubsan/TestCases/TypeCheck/Function/lit.local.cfg
+++ b/test/ubsan/TestCases/TypeCheck/Function/lit.local.cfg
@@ -1,3 +1,3 @@
# The function type checker is only supported on x86 and x86_64 for now.
-if config.root.host_arch not in ['x86', 'x86_64']:
+if config.target_arch not in ['x86', 'x86_64']:
config.unsupported = True
diff --git a/test/ubsan/lit.common.cfg b/test/ubsan/lit.common.cfg
index e165e72ed..8365194d8 100644
--- a/test/ubsan/lit.common.cfg
+++ b/test/ubsan/lit.common.cfg
@@ -46,6 +46,9 @@ if config.host_os == 'Darwin':
# much slower. Let's override this and run lit tests with 'abort_on_error=0'.
default_ubsan_opts += ['abort_on_error=0']
default_ubsan_opts += ['log_to_syslog=0']
+elif config.android:
+ default_ubsan_opts += ['abort_on_error=0']
+
default_ubsan_opts_str = ':'.join(default_ubsan_opts)
if default_ubsan_opts_str:
config.environment['UBSAN_OPTIONS'] = default_ubsan_opts_str
@@ -55,7 +58,7 @@ config.substitutions.append(('%env_ubsan_opts=',
'env UBSAN_OPTIONS=' + default_ubsan_opts_str))
def build_invocation(compile_flags):
- return " " + " ".join([config.clang] + compile_flags) + " "
+ return " " + " ".join([config.compile_wrapper, config.clang] + compile_flags) + " "
target_cflags = [get_required_attr(config, "target_cflags")]
clang_ubsan_cflags += target_cflags