diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2015-08-27 20:40:24 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-08-27 20:40:24 +0000 |
commit | d5cf8871a5c7a97d4142e710951aa6da86fcdbf3 (patch) | |
tree | 0c88d6bcd1915e9cdb321ad57d17821d6566e16f /test/ubsan | |
parent | 0d4ac1534aa164773dc4dd5cf42e6e35c387a039 (diff) |
[Sanitizers] Make abort_on_error common flag.
Summary:
Teach all sanitizers to call abort() instead of _exit() after printing
an error report, if requested. This behavior is the default on Mac OS.
Reviewers: kcc, kubabrecka
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D12332
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@246205 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ubsan')
-rw-r--r-- | test/ubsan/lit.common.cfg | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/test/ubsan/lit.common.cfg b/test/ubsan/lit.common.cfg index e5e5b7cfb..60b0b556c 100644 --- a/test/ubsan/lit.common.cfg +++ b/test/ubsan/lit.common.cfg @@ -14,6 +14,7 @@ def get_required_attr(config, attr_name): # Setup source root. config.test_source_root = os.path.dirname(__file__) +default_ubsan_opts = [] # Choose between standalone and UBSan+ASan modes. ubsan_lit_test_mode = get_required_attr(config, 'ubsan_lit_test_mode') if ubsan_lit_test_mode == "Standalone": @@ -24,13 +25,7 @@ elif ubsan_lit_test_mode == "AddressSanitizer": config.name = 'UBSan-ASan-' + config.target_arch config.available_features.add("ubsan-asan") clang_ubsan_cflags = ["-fsanitize=address"] - config.environment['ASAN_OPTIONS'] = 'detect_leaks=0' - - # Platform-specific default ASAN_OPTIONS for lit tests. - if config.host_os == 'Darwin': - # On Darwin, we default to `abort_on_error=1`, which would make tests run - # much slower. Let's override this and run lit tests with 'abort_on_error=0'. - config.environment['ASAN_OPTIONS'] = 'abort_on_error=0' + default_ubsan_opts += ['detect_leaks=0'] elif ubsan_lit_test_mode == "MemorySanitizer": config.name = 'UBSan-MSan-' + config.target_arch config.available_features.add("ubsan-msan") @@ -42,9 +37,18 @@ elif ubsan_lit_test_mode == "ThreadSanitizer": else: lit_config.fatal("Unknown UBSan test mode: %r" % ubsan_lit_test_mode) +# Platform-specific default for lit tests. +if config.host_os == 'Darwin': + # On Darwin, we default to `abort_on_error=1`, which would make tests run + # 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_str = ':'.join(default_ubsan_opts) +if default_ubsan_opts_str: + config.environment['UBSAN_OPTIONS'] = default_ubsan_opts_str + default_ubsan_opts_str += ':' # Substitution to setup UBSAN_OPTIONS in portable way. config.substitutions.append(('%env_ubsan_opts=', - 'env UBSAN_OPTIONS=')) + 'env UBSAN_OPTIONS=' + default_ubsan_opts_str)) def build_invocation(compile_flags): return " " + " ".join([config.clang] + compile_flags) + " " |