mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-15 12:39:19 +00:00
Stop defining negative versions of some lit feature keywords:
zlib/nozlib, asan/not_asan, msan/not_msan, ubsan/not_ubsan. We still have two other ways to express the absence of a feature. First, we have the '!' operator to invert the sense of a keyword. For example, given a feature that depends on zlib being unavailable, its test can say: REQUIRES: !zlib Second, if a test doesn't play well with some features, such as sanitizers, that test can say: UNSUPPORTED: asan, msan The different ways of writing these exclusions both have the same technical effect, but have different implications to the reader. llvm-svn: 360603
This commit is contained in:
parent
1aaf2a3c18
commit
b38e4b28e3
@ -9,10 +9,6 @@ from lit.llvm.subst import FindTool
|
||||
from lit.llvm.subst import ToolSubst
|
||||
|
||||
|
||||
def binary_feature(on, feature, off_prefix):
|
||||
return feature if on else off_prefix + feature
|
||||
|
||||
|
||||
class LLVMConfig(object):
|
||||
|
||||
def __init__(self, lit_config, config):
|
||||
@ -73,13 +69,16 @@ class LLVMConfig(object):
|
||||
# Sanitizers.
|
||||
sanitizers = getattr(config, 'llvm_use_sanitizer', '')
|
||||
sanitizers = frozenset(x.lower() for x in sanitizers.split(';'))
|
||||
features.add(binary_feature('address' in sanitizers, 'asan', 'not_'))
|
||||
features.add(binary_feature('memory' in sanitizers, 'msan', 'not_'))
|
||||
features.add(binary_feature(
|
||||
'undefined' in sanitizers, 'ubsan', 'not_'))
|
||||
if 'address' in sanitizers:
|
||||
features.add('asan')
|
||||
if 'memory' in sanitizers:
|
||||
features.add('msan')
|
||||
if 'undefined' in sanitizers:
|
||||
features.add('ubsan')
|
||||
|
||||
have_zlib = getattr(config, 'have_zlib', None)
|
||||
features.add(binary_feature(have_zlib, 'zlib', 'no'))
|
||||
if have_zlib:
|
||||
features.add('zlib')
|
||||
|
||||
# Check if we should run long running tests.
|
||||
long_tests = lit_config.params.get('run_long_tests', None)
|
||||
|
Loading…
x
Reference in New Issue
Block a user