diff options
Diffstat (limited to 'llvm/unittests')
-rw-r--r-- | llvm/unittests/IR/DominatorTreeTest.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/unittests/IR/DominatorTreeTest.cpp b/llvm/unittests/IR/DominatorTreeTest.cpp index 475b5b2232c..cf81623d0d1 100644 --- a/llvm/unittests/IR/DominatorTreeTest.cpp +++ b/llvm/unittests/IR/DominatorTreeTest.cpp @@ -776,7 +776,9 @@ TEST(DominatorTree, InsertFromUnreachable) { PDT.insertEdge(From, To); EXPECT_TRUE(PDT.verify()); EXPECT_TRUE(PDT.getRoots().size() == 2); - EXPECT_NE(PDT.getNode(B.getOrAddBlock("5")), nullptr); + // Make sure we can use a const pointer with getNode. + const BasicBlock *BB5 = B.getOrAddBlock("5"); + EXPECT_NE(PDT.getNode(BB5), nullptr); } TEST(DominatorTree, InsertMixed) { |