Index: llvm/utils/lit/lit/TestRunner.py =================================================================== --- llvm/utils/lit/lit/TestRunner.py +++ llvm/utils/lit/lit/TestRunner.py @@ -1463,9 +1463,9 @@ except ValueError as e: return lit.Test.Result(Test.UNRESOLVED, str(e)) script = parsed['RUN:'] or [] - test.xfails = parsed['XFAIL:'] or [] - test.requires = parsed['REQUIRES:'] or [] - test.unsupported = parsed['UNSUPPORTED:'] or [] + test.xfails = test.xfails + (parsed['XFAIL:'] or []) + test.requires = test.requires + (parsed['REQUIRES:'] or []) + test.unsupported = test.unsupported + (parsed['UNSUPPORTED:'] or []) if parsed['ALLOW_RETRIES:']: test.allowed_retries = parsed['ALLOW_RETRIES:'][0] Index: llvm/utils/lit/tests/Inputs/unparsed-requirements/test.py =================================================================== --- /dev/null +++ llvm/utils/lit/tests/Inputs/unparsed-requirements/test.py @@ -0,0 +1,2 @@ +# REQUIRES: woof +# RUN: Index: llvm/utils/lit/tests/unparsed-requirements.py =================================================================== --- /dev/null +++ llvm/utils/lit/tests/unparsed-requirements.py @@ -0,0 +1,18 @@ +# RUN: %{python} %s %{inputs}/unparsed-requirements 2> %t.err + +import sys +from lit.Test import Result, Test, TestSuite +from lit.TestRunner import parseIntegratedTestScript +from lit.TestingConfig import TestingConfig + +class CustomTest(Test): + def __init__(self, suite, path_in_suite, config, file_path = None): + Test.__init__(self, suite, path_in_suite, config, file_path) + self.requires = ["meow"] + +config = TestingConfig(None, "config", [".txt"], None, [], [], False, sys.argv[1], sys.argv[1], [], [], True) +suite = TestSuite("suite", sys.argv[1], sys.argv[1], config) +test = CustomTest(suite, ["test.py"], config) +parseIntegratedTestScript(test) +if test.requires != ["meow", "woof"]: + exit(1)