Skip to content

Commit

Permalink
[ORC] Fix more missing LLVMConsumeError calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
lhames authored and memfrob committed Oct 4, 2022
1 parent 69acfb8 commit 27e7772
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions llvm/unittests/ExecutionEngine/Orc/OrcCAPITest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ TEST_F(OrcCAPITestBase, MaterializationUnitCreation) {
LLVMOrcMaterializationUnitRef MU = LLVMOrcAbsoluteSymbols(Pairs, 1);
LLVMOrcJITDylibDefine(MainDylib, MU);
LLVMOrcJITTargetAddress OutAddr;
if (LLVMOrcLLJITLookup(Jit, &OutAddr, "test")) {
if (LLVMErrorRef E = LLVMOrcLLJITLookup(Jit, &OutAddr, "test")) {
LLVMConsumeError(E);
FAIL() << "Failed to look up \"test\" symbol (triple = "
<< TargetTriple << ")";
}
Expand All @@ -231,7 +232,8 @@ TEST_F(OrcCAPITestBase, DefinitionGenerators) {
nullptr);
LLVMOrcJITDylibAddGenerator(MainDylib, Gen);
LLVMOrcJITTargetAddress OutAddr;
if (LLVMOrcLLJITLookup(Jit, &OutAddr, "test")) {
if (LLVMErrorRef E = LLVMOrcLLJITLookup(Jit, &OutAddr, "test")) {
LLVMConsumeError(E);
FAIL() << "The DefinitionGenerator did not create symbol \"test\" "
<< "(triple = " << TargetTriple << ")";
}
Expand All @@ -253,11 +255,13 @@ TEST_F(OrcCAPITestBase, ResourceTrackerDefinitionLifetime) {
LLVMOrcJITDylibCreateResourceTracker(MainDylib);
LLVMOrcThreadSafeModuleRef TSM = createTestModule();
if (LLVMErrorRef E = LLVMOrcLLJITAddLLVMIRModuleWithRT(Jit, RT, TSM)) {
LLVMConsumeError(E);
FAIL() << "Failed to add LLVM IR module to LLJIT (triple = "
<< TargetTriple << ")";
}
LLVMOrcJITTargetAddress TestFnAddr;
if (LLVMOrcLLJITLookup(Jit, &TestFnAddr, "sum")) {
if (LLVMErrorRef E = LLVMOrcLLJITLookup(Jit, &TestFnAddr, "sum")) {
LLVMConsumeError(E);
FAIL() << "Symbol \"sum\" was not added into JIT (triple = "
<< TargetTriple << ")";
}
Expand All @@ -283,11 +287,13 @@ TEST_F(OrcCAPITestBase, ResourceTrackerTransfer) {
LLVMOrcJITDylibCreateResourceTracker(MainDylib);
LLVMOrcThreadSafeModuleRef TSM = createTestModule();
if (LLVMErrorRef E = LLVMOrcLLJITAddLLVMIRModuleWithRT(Jit, DefaultRT, TSM)) {
LLVMConsumeError(E);
FAIL() << "Failed to add LLVM IR module to LLJIT (triple = "
<< TargetTriple << ")";
}
LLVMOrcJITTargetAddress Addr;
if (LLVMOrcLLJITLookup(Jit, &Addr, "sum")) {
if (LLVMErrorRef E = LLVMOrcLLJITLookup(Jit, &Addr, "sum")) {
LLVMConsumeError(E);
FAIL() << "Symbol \"sum\" was not added into JIT (triple = "
<< TargetTriple << ")";
}
Expand Down

0 comments on commit 27e7772

Please sign in to comment.