diff options
Diffstat (limited to 'compiler-rt')
| -rw-r--r-- | compiler-rt/test/asan/TestCases/Linux/abort_on_error.cc | 2 | ||||
| -rw-r--r-- | compiler-rt/test/asan/TestCases/atexit_stats.cc | 4 | ||||
| -rwxr-xr-x | compiler-rt/test/asan/android_commands/android_run.py | 9 | ||||
| -rw-r--r-- | compiler-rt/test/asan/lit.cfg | 6 |
4 files changed, 17 insertions, 4 deletions
diff --git a/compiler-rt/test/asan/TestCases/Linux/abort_on_error.cc b/compiler-rt/test/asan/TestCases/Linux/abort_on_error.cc index 67fa9b83e65..3f70613e4c7 100644 --- a/compiler-rt/test/asan/TestCases/Linux/abort_on_error.cc +++ b/compiler-rt/test/asan/TestCases/Linux/abort_on_error.cc @@ -9,6 +9,8 @@ // lit doesn't set ASAN_OPTIONS anyway. // RUN: not %run %t 2>&1 | FileCheck %s +// UNSUPPORTED: android + #include <stdlib.h> int main() { char *x = (char*)malloc(10 * sizeof(char)); diff --git a/compiler-rt/test/asan/TestCases/atexit_stats.cc b/compiler-rt/test/asan/TestCases/atexit_stats.cc index 42a3fbf23f5..f0b5830b405 100644 --- a/compiler-rt/test/asan/TestCases/atexit_stats.cc +++ b/compiler-rt/test/asan/TestCases/atexit_stats.cc @@ -2,9 +2,9 @@ // RUN: %clangxx_asan -O3 %s -o %t // RUN: %env_asan_opts=atexit=1:print_stats=1 %run %t 2>&1 | FileCheck %s // -// No atexit output on Android due to +// No atexit output in older versions of Android due to // https://code.google.com/p/address-sanitizer/issues/detail?id=263 -// XFAIL: android +// UNSUPPORTED: android #include <stdlib.h> #if !defined(__APPLE__) && !defined(__FreeBSD__) diff --git a/compiler-rt/test/asan/android_commands/android_run.py b/compiler-rt/test/asan/android_commands/android_run.py index 272d2110e5a..9f7bdeef577 100755 --- a/compiler-rt/test/asan/android_commands/android_run.py +++ b/compiler-rt/test/asan/android_commands/android_run.py @@ -1,6 +1,6 @@ #!/usr/bin/python -import os, sys, subprocess, tempfile +import os, signal, sys, subprocess, tempfile from android_common import * ANDROID_TMPDIR = '/data/local/tmp/Output' @@ -34,4 +34,9 @@ if ret != 0: sys.stdout.write(pull_from_device(device_stdout)) sys.stderr.write(pull_from_device(device_stderr)) -sys.exit(int(pull_from_device(device_exitcode))) +retcode = int(pull_from_device(device_exitcode)) +# If the device process died with a signal, do abort(). +# Not exactly the same, but good enough to fool "not --crash". +if retcode > 128: + os.kill(os.getpid(), signal.SIGABRT) +sys.exit(retcode) diff --git a/compiler-rt/test/asan/lit.cfg b/compiler-rt/test/asan/lit.cfg index f2c0c872e01..feb851bcd6a 100644 --- a/compiler-rt/test/asan/lit.cfg +++ b/compiler-rt/test/asan/lit.cfg @@ -37,6 +37,12 @@ if config.host_os == 'Darwin': # Also, make sure we do not overwhelm the syslog while testing. default_asan_opts = 'abort_on_error=0' default_asan_opts += ':log_to_syslog=0' +elif config.android: + # The same as on Darwin, we default to "abort_on_error=1" which slows down + # testing. Also, all existing tests are using "not" instead of "not --crash" + # which does not work for abort()-terminated programs. + default_asan_opts = 'abort_on_error=0' + if default_asan_opts: config.environment['ASAN_OPTIONS'] = default_asan_opts default_asan_opts += ':' |

