Index: test/lit.cfg =================================================================== --- test/lit.cfg +++ test/lit.cfg @@ -64,6 +64,7 @@ def _execute(self, test, lit_config): # Extract test metadata from the test file. requires = [] + excludes = [] with open(test.getSourcePath()) as f: for ln in f: if 'XFAIL:' in ln: @@ -72,6 +73,9 @@ elif 'REQUIRES:' in ln: items = ln[ln.index('REQUIRES:') + 9:].split(',') requires.extend([s.strip() for s in items]) + elif 'EXCLUDES:' in ln: + items = ln[ln.index('EXCLUDES:') + 9:].split(',') + excludes.extend([s.strip() for s in items]) elif not ln.strip().startswith("//") and ln.strip(): # Stop at the first non-empty line that is not a C++ # comment. @@ -83,12 +87,21 @@ # introducing a dependency there. What we more ideally would like to do # is lift the "requires" handling to be a core lit framework feature. missing_required_features = [f for f in requires - if f not in test.config.available_features] + if f not in test.config.available_features + and f not in test.config.target_triple] if missing_required_features: return (lit.Test.UNSUPPORTED, "Test requires the following features: %s" % ( ', '.join(missing_required_features),)) + excluded_features = [f for f in excludes + if f in test.config.available_features + or f in test.config.target_triple] + if excluded_features: + return (lit.Test.UNSUPPORTED, + "Test excludes the following features: %s" % ( + ', '.join(excluded_features),)) + # Evaluate the test. return self._evaluate_test(test, lit_config)