From d215fd3b74b90f5dc1964610926fcc2a20f959aa Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 6 Jan 2018 21:34:26 +0000 Subject: Vendor import of llvm release_60 branch r321788: https://llvm.org/svn/llvm-project/llvm/branches/release_60@321788 --- unittests/IR/BasicBlockTest.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'unittests/IR/BasicBlockTest.cpp') diff --git a/unittests/IR/BasicBlockTest.cpp b/unittests/IR/BasicBlockTest.cpp index f1777e35b82c..08a41ff36938 100644 --- a/unittests/IR/BasicBlockTest.cpp +++ b/unittests/IR/BasicBlockTest.cpp @@ -33,6 +33,12 @@ TEST(BasicBlockTest, PhiRange) { std::unique_ptr BB2(BasicBlock::Create(Context)); BranchInst::Create(BB.get(), BB2.get()); + // Make sure this doesn't crash if there are no phis. + for (auto &PN : BB->phis()) { + (void)PN; + EXPECT_TRUE(false) << "empty block should have no phis"; + } + // Make it a cycle. auto *BI = BranchInst::Create(BB.get(), BB.get()); -- cgit v1.3