diff options
Diffstat (limited to 'test/ubsan/lit.common.cfg')
-rw-r--r-- | test/ubsan/lit.common.cfg | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/test/ubsan/lit.common.cfg b/test/ubsan/lit.common.cfg index e3a1367e748ac..83475a2dc36c0 100644 --- a/test/ubsan/lit.common.cfg +++ b/test/ubsan/lit.common.cfg @@ -11,27 +11,29 @@ def get_required_attr(config, attr_name): "to lit.site.cfg " % attr_name) return attr_value +# Setup config name. +config.name = 'UBSan-' + config.name_suffix + # Setup source root. config.test_source_root = os.path.dirname(__file__) -default_ubsan_opts = [] +default_ubsan_opts = list(config.default_sanitizer_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": - config.name = 'UBSan-Standalone-' + config.target_arch config.available_features.add("ubsan-standalone") clang_ubsan_cflags = [] +elif ubsan_lit_test_mode == "StandaloneStatic": + config.available_features.add("ubsan-standalone-static") + clang_ubsan_cflags = ['-static-libsan'] elif ubsan_lit_test_mode == "AddressSanitizer": - config.name = 'UBSan-ASan-' + config.target_arch config.available_features.add("ubsan-asan") clang_ubsan_cflags = ["-fsanitize=address"] 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") clang_ubsan_cflags = ["-fsanitize=memory"] elif ubsan_lit_test_mode == "ThreadSanitizer": - config.name = 'UBSan-TSan-' + config.target_arch config.available_features.add("ubsan-tsan") clang_ubsan_cflags = ["-fsanitize=thread"] else: @@ -41,11 +43,7 @@ else: if config.target_arch == 's390x': # On SystemZ we need -mbackchain to make the fast unwinder work. clang_ubsan_cflags.append("-mbackchain") -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 += ['log_to_syslog=0'] + default_ubsan_opts_str = ':'.join(default_ubsan_opts) if default_ubsan_opts_str: config.environment['UBSAN_OPTIONS'] = default_ubsan_opts_str @@ -70,10 +68,9 @@ config.substitutions.append( ("%gmlt ", " ".join(config.debug_info_flags) + " ") config.suffixes = ['.c', '.cc', '.cpp'] # Check that the host supports UndefinedBehaviorSanitizer tests -if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'Windows']: +if config.host_os not in ['Linux', 'Darwin', 'FreeBSD', 'Windows', 'NetBSD']: config.unsupported = True -# Allow tests to use REQUIRES=stable-runtime. For use when you cannot use XFAIL -# because the test hangs or fails on one configuration and not the other. -if config.target_arch.startswith('arm') == False and config.target_arch != 'aarch64': - config.available_features.add('stable-runtime') +config.available_features.add('arch=' + config.target_arch) + +config.excludes = ['Inputs'] |