[llvm] [orc-rt] Use the Error matchers in InProcessControllerAccessTest (PR #228702)

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 3 05:25:59 PDT 2026


https://github.com/lhames created https://github.com/llvm/llvm-project/pull/228702

Use the Error matchers introduced in 4c8a437d0487 in place of cantFail on calls that can fail, so that a failure is reported as a test failure rather than aborting the test binary (or, with assertions disabled, going unnoticed).

>From b75719a4dad8dffcd8a062f04ce89dc96d20fe0f Mon Sep 17 00:00:00 2001
From: Lang Hames <lhames at gmail.com>
Date: Thu, 1 Oct 2026 16:20:53 +1000
Subject: [PATCH] [orc-rt] Use the Error matchers in
 InProcessControllerAccessTest

Use the Error matchers introduced in 4c8a437d0487 in place of cantFail
on calls that can fail, so that a failure is reported as a test failure
rather than aborting the test binary (or, with assertions disabled,
going unnoticed).
---
 orc-rt/test/unit/bedrock/InProcessControllerAccessTest.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/orc-rt/test/unit/bedrock/InProcessControllerAccessTest.cpp b/orc-rt/test/unit/bedrock/InProcessControllerAccessTest.cpp
index e8535241ff62e91..bdc9f8807da11c1 100644
--- a/orc-rt/test/unit/bedrock/InProcessControllerAccessTest.cpp
+++ b/orc-rt/test/unit/bedrock/InProcessControllerAccessTest.cpp
@@ -332,7 +332,9 @@ TEST(InProcessControllerAccessTest, BootstrapValuesExposeSubtargetFeatures) {
   Session S(mockExecutorProcessInfo(), noDispatch, noErrors);
   std::optional<std::string> Features;
   std::unique_ptr<MockIPEPC> Mock;
-  attachWithMock(S, Mock, cantFail(BootstrapInfo::CreateDefault(S)),
+  auto BI = BootstrapInfo::CreateDefault(S);
+  ASSERT_THAT_EXPECTED(BI, Succeeded());
+  attachWithMock(S, Mock, std::move(*BI),
                  [&](InProcessControllerAccess::BootstrapInfoAccess *BIA) {
                    const char *Name = nullptr;
                    const char *Bytes = nullptr;



More information about the llvm-commits mailing list