summaryrefslogtreecommitdiffstats
path: root/unittests/Linker/LinkModulesTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'unittests/Linker/LinkModulesTest.cpp')
-rw-r--r--unittests/Linker/LinkModulesTest.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/unittests/Linker/LinkModulesTest.cpp b/unittests/Linker/LinkModulesTest.cpp
index 91f97d7..fbd0363 100644
--- a/unittests/Linker/LinkModulesTest.cpp
+++ b/unittests/Linker/LinkModulesTest.cpp
@@ -35,7 +35,7 @@ protected:
SwitchCase2BB = BasicBlock::Create(Ctx, "switch.case.2", F);
ExitBB = BasicBlock::Create(Ctx, "exit", F);
- ArrayType *AT = ArrayType::get(Type::getInt8PtrTy(Ctx), 3);
+ AT = ArrayType::get(Type::getInt8PtrTy(Ctx), 3);
GV = new GlobalVariable(*M.get(), AT, false /*=isConstant*/,
GlobalValue::InternalLinkage, nullptr,"switch.bas");
@@ -61,6 +61,7 @@ protected:
LLVMContext Ctx;
std::unique_ptr<Module> M;
Function *F;
+ ArrayType *AT;
GlobalVariable *GV;
BasicBlock *EntryBB;
BasicBlock *SwitchCase1BB;
@@ -75,7 +76,7 @@ TEST_F(LinkModuleTest, BlockAddress) {
GEPIndices.push_back(ConstantInt::get(Type::getInt32Ty(Ctx), 0));
GEPIndices.push_back(F->arg_begin());
- Value *GEP = Builder.CreateGEP(GV, GEPIndices, "switch.gep");
+ Value *GEP = Builder.CreateGEP(AT, GV, GEPIndices, "switch.gep");
Value *Load = Builder.CreateLoad(GEP, "switch.load");
Builder.CreateRet(Load);