[libcxx-commits] [PATCH] D143245: [libc++] In tests, use `abort` to terminate upon an error.

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 2 23:58:48 PST 2023


var-const created this revision.
Herald added a project: All.
var-const requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143245

Files:
  libcxx/test/support/assert_macros.h


Index: libcxx/test/support/assert_macros.h
===================================================================
--- libcxx/test/support/assert_macros.h
+++ libcxx/test/support/assert_macros.h
@@ -65,7 +65,7 @@
 [[noreturn]] void test_log_error(const char* condition, const char* file, int line, std::string&& message) {
   const char* msg = condition ? "Assertion failure: " : "Unconditional failure:";
   std::fprintf(stderr, "%s%s %s %d\n%s", msg, condition, file, line, message.c_str());
-  exit(EXIT_FAILURE);
+  std::abort();
 }
 
 inline void test_fail(const char* file, int line, std::string&& message) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143245.494528.patch
Type: text/x-patch
Size: 611 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230203/e095dacc/attachment.bin>


More information about the libcxx-commits mailing list