diff --git a/test/lit.cfg b/test/lit.cfg index df42dbc4..d7ace851 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -43,6 +43,7 @@ class LibcxxTestFormat(lit.formats.FileBasedTest): # Check what kind of test this is. assert name.endswith('.pass.cpp') or name.endswith('.fail.cpp') expected_compile_fail = name.endswith('.fail.cpp') + expected_run_fail = name.endswith('.xfail.pass.cpp') # If this is a compile (failure) test, build it and check for failure. if expected_compile_fail: @@ -84,6 +85,11 @@ class LibcxxTestFormat(lit.formats.FileBasedTest): cmd = [exec_path] out, err, exitCode = self.execute_command(cmd) + if expected_run_fail: + if (exitCode != 0): + return lit.Test.XFAIL, "" + else: + return lit.Test.XPASS, "" if exitCode != 0: report = """Compiled With: %s\n""" % ' '.join(["'%s'" % a for a in compile_cmd])