1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[ORC] Fix more missing LLVMConsumeError calls.

This commit is contained in:
Lang Hames 2021-04-26 21:44:26 -07:00
parent 333bc847e7
commit 34687a6961

View File

@ -213,7 +213,8 @@ TEST_F(OrcCAPITestBase, MaterializationUnitCreation) {
LLVMOrcMaterializationUnitRef MU = LLVMOrcAbsoluteSymbols(Pairs, 1); LLVMOrcMaterializationUnitRef MU = LLVMOrcAbsoluteSymbols(Pairs, 1);
LLVMOrcJITDylibDefine(MainDylib, MU); LLVMOrcJITDylibDefine(MainDylib, MU);
LLVMOrcJITTargetAddress OutAddr; LLVMOrcJITTargetAddress OutAddr;
if (LLVMOrcLLJITLookup(Jit, &OutAddr, "test")) { if (LLVMErrorRef E = LLVMOrcLLJITLookup(Jit, &OutAddr, "test")) {
LLVMConsumeError(E);
FAIL() << "Failed to look up \"test\" symbol (triple = " FAIL() << "Failed to look up \"test\" symbol (triple = "
<< TargetTriple << ")"; << TargetTriple << ")";
} }
@ -231,7 +232,8 @@ TEST_F(OrcCAPITestBase, DefinitionGenerators) {
nullptr); nullptr);
LLVMOrcJITDylibAddGenerator(MainDylib, Gen); LLVMOrcJITDylibAddGenerator(MainDylib, Gen);
LLVMOrcJITTargetAddress OutAddr; LLVMOrcJITTargetAddress OutAddr;
if (LLVMOrcLLJITLookup(Jit, &OutAddr, "test")) { if (LLVMErrorRef E = LLVMOrcLLJITLookup(Jit, &OutAddr, "test")) {
LLVMConsumeError(E);
FAIL() << "The DefinitionGenerator did not create symbol \"test\" " FAIL() << "The DefinitionGenerator did not create symbol \"test\" "
<< "(triple = " << TargetTriple << ")"; << "(triple = " << TargetTriple << ")";
} }
@ -253,11 +255,13 @@ TEST_F(OrcCAPITestBase, ResourceTrackerDefinitionLifetime) {
LLVMOrcJITDylibCreateResourceTracker(MainDylib); LLVMOrcJITDylibCreateResourceTracker(MainDylib);
LLVMOrcThreadSafeModuleRef TSM = createTestModule(); LLVMOrcThreadSafeModuleRef TSM = createTestModule();
if (LLVMErrorRef E = LLVMOrcLLJITAddLLVMIRModuleWithRT(Jit, RT, TSM)) { if (LLVMErrorRef E = LLVMOrcLLJITAddLLVMIRModuleWithRT(Jit, RT, TSM)) {
LLVMConsumeError(E);
FAIL() << "Failed to add LLVM IR module to LLJIT (triple = " FAIL() << "Failed to add LLVM IR module to LLJIT (triple = "
<< TargetTriple << ")"; << TargetTriple << ")";
} }
LLVMOrcJITTargetAddress TestFnAddr; 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 = " FAIL() << "Symbol \"sum\" was not added into JIT (triple = "
<< TargetTriple << ")"; << TargetTriple << ")";
} }
@ -283,11 +287,13 @@ TEST_F(OrcCAPITestBase, ResourceTrackerTransfer) {
LLVMOrcJITDylibCreateResourceTracker(MainDylib); LLVMOrcJITDylibCreateResourceTracker(MainDylib);
LLVMOrcThreadSafeModuleRef TSM = createTestModule(); LLVMOrcThreadSafeModuleRef TSM = createTestModule();
if (LLVMErrorRef E = LLVMOrcLLJITAddLLVMIRModuleWithRT(Jit, DefaultRT, TSM)) { if (LLVMErrorRef E = LLVMOrcLLJITAddLLVMIRModuleWithRT(Jit, DefaultRT, TSM)) {
LLVMConsumeError(E);
FAIL() << "Failed to add LLVM IR module to LLJIT (triple = " FAIL() << "Failed to add LLVM IR module to LLJIT (triple = "
<< TargetTriple << ")"; << TargetTriple << ")";
} }
LLVMOrcJITTargetAddress Addr; 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 = " FAIL() << "Symbol \"sum\" was not added into JIT (triple = "
<< TargetTriple << ")"; << TargetTriple << ")";
} }