diff options
Diffstat (limited to 'llvm/unittests/Analysis/PhiValuesTest.cpp')
-rw-r--r-- | llvm/unittests/Analysis/PhiValuesTest.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/unittests/Analysis/PhiValuesTest.cpp b/llvm/unittests/Analysis/PhiValuesTest.cpp index 6fd3f6d6654..ec60255cf12 100644 --- a/llvm/unittests/Analysis/PhiValuesTest.cpp +++ b/llvm/unittests/Analysis/PhiValuesTest.cpp @@ -26,8 +26,7 @@ TEST(PhiValuesTest, SimplePhi) { Type *I32PtrTy = Type::getInt32PtrTy(C); // Create a function with phis that do not have other phis as incoming values - Function *F = Function::Create(FunctionType::get(VoidTy, false), - Function::ExternalLinkage, "f", M); + Function *F = cast<Function>(M.getOrInsertFunction("f", FunctionType::get(VoidTy, false))); BasicBlock *Entry = BasicBlock::Create(C, "entry", F); BasicBlock *If = BasicBlock::Create(C, "if", F); @@ -93,8 +92,7 @@ TEST(PhiValuesTest, DependentPhi) { Type *I32PtrTy = Type::getInt32PtrTy(C); // Create a function with a phi that has another phi as an incoming value - Function *F = Function::Create(FunctionType::get(VoidTy, false), - Function::ExternalLinkage, "f", M); + Function *F = cast<Function>(M.getOrInsertFunction("f", FunctionType::get(VoidTy, false))); BasicBlock *Entry = BasicBlock::Create(C, "entry", F); BasicBlock *If1 = BasicBlock::Create(C, "if1", F); |