llvm.org GIT mirror llvm / b5d2525
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360603 91177308-0d34-0410-b5e6-96231b3b80d8 Paul Robinson 3 months ago
1 changed file(s) with 8 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
66 import lit.util
77 from lit.llvm.subst import FindTool
88 from lit.llvm.subst import ToolSubst
9
10
11 def binary_feature(on, feature, off_prefix):
12 return feature if on else off_prefix + feature
139
1410
1511 class LLVMConfig(object):
7268 # Sanitizers.
7369 sanitizers = getattr(config, 'llvm_use_sanitizer', '')
7470 sanitizers = frozenset(x.lower() for x in sanitizers.split(';'))
75 features.add(binary_feature('address' in sanitizers, 'asan', 'not_'))
76 features.add(binary_feature('memory' in sanitizers, 'msan', 'not_'))
77 features.add(binary_feature(
78 'undefined' in sanitizers, 'ubsan', 'not_'))
71 if 'address' in sanitizers:
72 features.add('asan')
73 if 'memory' in sanitizers:
74 features.add('msan')
75 if 'undefined' in sanitizers:
76 features.add('ubsan')
7977
8078 have_zlib = getattr(config, 'have_zlib', None)
81 features.add(binary_feature(have_zlib, 'zlib', 'no'))
79 if have_zlib:
80 features.add('zlib')
8281
8382 # Check if we should run long running tests.
8483 long_tests = lit_config.params.get('run_long_tests', None)