[llvm] e00ade1 - [llvm-c] Mitigate debug support test for systems that still default to RuntimeDyld

Stefan Gränitz via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 01:27:13 PST 2023


Author: Stefan Gränitz
Date: 2023-12-12T10:26:54+01:00
New Revision: e00ade1144ef661b01e195e4bf4a3e4b18c4328f

URL: https://github.com/llvm/llvm-project/commit/e00ade1144ef661b01e195e4bf4a3e4b18c4328f
DIFF: https://github.com/llvm/llvm-project/commit/e00ade1144ef661b01e195e4bf4a3e4b18c4328f.diff

LOG: [llvm-c] Mitigate debug support test for systems that still default to RuntimeDyld

Fix test failure reported from buildbot clang-s390x-linux-lnt after #73257
OrcCAPITest.cpp:562: Debugger support requires JITLink

Added: 
    

Modified: 
    llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp b/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
index 65d2f57234d0a..d62973f30add9 100644
--- a/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
@@ -14,6 +14,7 @@
 #include "gtest/gtest.h"
 
 #include "llvm/ExecutionEngine/Orc/CompileUtils.h"
+#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
 #include "llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Module.h"
@@ -28,6 +29,7 @@
 using namespace llvm;
 using namespace llvm::orc;
 
+DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ObjectLayer, LLVMOrcObjectLayerRef)
 DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ThreadSafeModule, LLVMOrcThreadSafeModuleRef)
 
 // OrcCAPITestBase contains several helper methods and pointers for unit tests
@@ -558,13 +560,17 @@ static LLVM_ATTRIBUTE_USED void linkComponents() {
 }
 TEST_F(OrcCAPITestBase, EnableDebugSupport) {
 #endif
-  if (LLVMErrorRef E = LLVMOrcLLJITEnableDebugSupport(Jit))
-    FAIL() << "Error testing LLJIT debug support (triple = " << TargetTriple
-           << "): " << toString(E);
-
   void *Before = findLastDebugDescriptorEntryPtr();
   LLVMMemoryBufferRef ObjBuffer = createTestObject(SumDebugExample, "sum.ll");
   LLVMOrcObjectLayerRef ObjLayer = LLVMOrcLLJITGetObjLinkingLayer(Jit);
+
+  if (LLVMErrorRef E = LLVMOrcLLJITEnableDebugSupport(Jit)) {
+    EXPECT_FALSE(isa<ObjectLinkingLayer>(unwrap(ObjLayer)))
+        << "Error testing LLJIT debug support "
+        << "(triple = " << TargetTriple << "): " << toString(E);
+    GTEST_SKIP() << "LLJIT C bindings provide debug support only for JITLink";
+  }
+
   if (LLVMErrorRef E =
           LLVMOrcObjectLayerAddObjectFile(ObjLayer, MainDylib, ObjBuffer))
     FAIL() << "Failed to add object file to ObjLinkingLayer (triple = "


        


More information about the llvm-commits mailing list