[libc++] Accept any non-zero return for .fail.cpp tests

llvm-svn: 367930
This commit is contained in:
Louis Dionne 2019-08-05 21:26:50 +00:00
parent 1d73e228db
commit d131713307
1 changed files with 2 additions and 2 deletions

View File

@ -255,9 +255,9 @@ class LibcxxTestFormat(object):
if any(test_str in contents for test_str in test_str_list):
test_cxx.flags += ['-Werror=unused-result']
cmd, out, err, rc = test_cxx.compile(source_path, out=os.devnull)
expected_rc = 0 if use_verify else 1
check_rc = lambda rc: rc == 0 if use_verify else rc != 0
report = libcxx.util.makeReport(cmd, out, err, rc)
if rc == expected_rc:
if check_rc(rc):
return lit.Test.Result(lit.Test.PASS, report)
else:
report += ('Expected compilation to fail!\n' if not use_verify else