summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/unittests/IR/DominatorTreeTest.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2017-01-24 08:32:59 +0000
committerpatrick <patrick@openbsd.org>2017-01-24 08:32:59 +0000
commit53d771aafdbe5b919f264f53cba3788e2c4cffd2 (patch)
tree7eca39498be0ff1e3a6daf583cd9ca5886bb2636 /gnu/llvm/unittests/IR/DominatorTreeTest.cpp
parentIn preparation of compiling our kernels with -ffreestanding, explicitly map (diff)
downloadwireguard-openbsd-53d771aafdbe5b919f264f53cba3788e2c4cffd2.tar.xz
wireguard-openbsd-53d771aafdbe5b919f264f53cba3788e2c4cffd2.zip
Import LLVM 4.0.0 rc1 including clang and lld to help the current
development effort on OpenBSD/arm64.
Diffstat (limited to 'gnu/llvm/unittests/IR/DominatorTreeTest.cpp')
-rw-r--r--gnu/llvm/unittests/IR/DominatorTreeTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/gnu/llvm/unittests/IR/DominatorTreeTest.cpp b/gnu/llvm/unittests/IR/DominatorTreeTest.cpp
index 6c49deb32d9..ae9c2684212 100644
--- a/gnu/llvm/unittests/IR/DominatorTreeTest.cpp
+++ b/gnu/llvm/unittests/IR/DominatorTreeTest.cpp
@@ -203,6 +203,16 @@ namespace llvm {
EXPECT_EQ(DT->getNode(BB4)->getDFSNumIn(), 5UL);
EXPECT_EQ(DT->getNode(BB4)->getDFSNumOut(), 6UL);
+ // Change root node
+ DT->verifyDomTree();
+ BasicBlock *NewEntry = BasicBlock::Create(F.getContext(), "new_entry",
+ &F, BB0);
+ BranchInst::Create(BB0, NewEntry);
+ EXPECT_EQ(F.begin()->getName(), NewEntry->getName());
+ EXPECT_TRUE(&F.getEntryBlock() == NewEntry);
+ DT->setNewRoot(NewEntry);
+ DT->verifyDomTree();
+
return false;
}
void getAnalysisUsage(AnalysisUsage &AU) const override {