[compiler-rt] Log errno (or fuchsia equivalent) on map failures (PR #95391)

Mitch Phillips via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 25 00:24:52 PDT 2024


================
@@ -0,0 +1,24 @@
+//===-- utilities.cpp -------------------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "gwp_asan/utilities.h"
+#include "gwp_asan/tests/harness.h"
+
+using gwp_asan::Check;
+using gwp_asan::checkWithErrorCode;
+
+TEST(UtilitiesDeathTest, CheckPrintsAsExpected) {
+  EXPECT_DEATH({ Check(false, "Hello world"); }, "Hello world");
+  Check(true, "Should not crash");
+  EXPECT_DEATH(
+      { checkWithErrorCode(false, "Hello world", 1337); },
+      "Hello world \\(Error Code: 1337\\)");
----------------
hctim wrote:

ack

https://github.com/llvm/llvm-project/pull/95391


More information about the llvm-commits mailing list