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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@367930 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/libcxx/test/format.py b/utils/libcxx/test/format.py
index 1220142..f8d0a85 100644
--- a/utils/libcxx/test/format.py
+++ b/utils/libcxx/test/format.py
@@ -255,9 +255,9 @@
             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