[llvm] [ORC] Fix OrcCAPITestBase.ExecutionTest on Darwin/arm64e (PR #223577)

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 14 18:08:12 PDT 2026


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

Switch to ExecutorAddr::toPtr to sign the function pointer. We'll need a C API solution for this eventually, but this will do for now to get the test passing.

rdar://186687669

>From 678138b23428a63ea88d603eff98e75e7b73613c Mon Sep 17 00:00:00 2001
From: Lang Hames <lhames at gmail.com>
Date: Tue, 15 Sep 2026 11:02:27 +1000
Subject: [PATCH] [ORC] Fix OrcCAPITestBase.ExecutionTest on Darwin/arm64e

Switch to ExecutorAddr::toPtr to sign the function pointer. We'll need a
C API solution for this eventually, but this will do for now to get the
test passing.

rdar://186687669
---
 llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp b/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
index 0ddbb33c4bac5c..2827554a74c5e9 100644
--- a/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
@@ -593,7 +593,9 @@ TEST_F(OrcCAPITestBase, ExecutionTest) {
   if (LLVMErrorRef E = LLVMOrcLLJITLookup(Jit, &TestFnAddr, "sum"))
     FAIL() << "Symbol \"sum\" was not added into JIT (triple = " << TargetTriple
            << "): " << toString(E);
-  auto *SumFn = (SumFunctionType)(TestFnAddr);
+  // FIXME: We use ExecutorAddr::toPtr here to sign arm64e pointers. We should
+  //        develop a C API solution for this.
+  auto *SumFn = ExecutorAddr(TestFnAddr).toPtr<SumFunctionType>();
   int32_t Result = SumFn(1, 1);
   ASSERT_EQ(2, Result);
 }



More information about the llvm-commits mailing list