Skip to content

Commit e00ade1

Browse files
[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
1 parent cbf1d58 commit e00ade1

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "gtest/gtest.h"
1515

1616
#include "llvm/ExecutionEngine/Orc/CompileUtils.h"
17+
#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h"
1718
#include "llvm/ExecutionEngine/Orc/TargetProcess/JITLoaderGDB.h"
1819
#include "llvm/IR/LLVMContext.h"
1920
#include "llvm/IR/Module.h"
@@ -28,6 +29,7 @@
2829
using namespace llvm;
2930
using namespace llvm::orc;
3031

32+
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ObjectLayer, LLVMOrcObjectLayerRef)
3133
DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ThreadSafeModule, LLVMOrcThreadSafeModuleRef)
3234

3335
// OrcCAPITestBase contains several helper methods and pointers for unit tests
@@ -558,13 +560,17 @@ static LLVM_ATTRIBUTE_USED void linkComponents() {
558560
}
559561
TEST_F(OrcCAPITestBase, EnableDebugSupport) {
560562
#endif
561-
if (LLVMErrorRef E = LLVMOrcLLJITEnableDebugSupport(Jit))
562-
FAIL() << "Error testing LLJIT debug support (triple = " << TargetTriple
563-
<< "): " << toString(E);
564-
565563
void *Before = findLastDebugDescriptorEntryPtr();
566564
LLVMMemoryBufferRef ObjBuffer = createTestObject(SumDebugExample, "sum.ll");
567565
LLVMOrcObjectLayerRef ObjLayer = LLVMOrcLLJITGetObjLinkingLayer(Jit);
566+
567+
if (LLVMErrorRef E = LLVMOrcLLJITEnableDebugSupport(Jit)) {
568+
EXPECT_FALSE(isa<ObjectLinkingLayer>(unwrap(ObjLayer)))
569+
<< "Error testing LLJIT debug support "
570+
<< "(triple = " << TargetTriple << "): " << toString(E);
571+
GTEST_SKIP() << "LLJIT C bindings provide debug support only for JITLink";
572+
}
573+
568574
if (LLVMErrorRef E =
569575
LLVMOrcObjectLayerAddObjectFile(ObjLayer, MainDylib, ObjBuffer))
570576
FAIL() << "Failed to add object file to ObjLinkingLayer (triple = "

0 commit comments

Comments
 (0)