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