diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-01-06 21:34:26 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-01-06 21:34:26 +0000 |
commit | d215fd3b74b90f5dc1964610926fcc2a20f959aa (patch) | |
tree | 0c9f21e40eae033d6760008729f37d2103e2c654 /unittests/IR/BasicBlockTest.cpp | |
parent | b8a2042aa938069e862750553db0e4d82d25822c (diff) |
Diffstat (limited to 'unittests/IR/BasicBlockTest.cpp')
-rw-r--r-- | unittests/IR/BasicBlockTest.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/unittests/IR/BasicBlockTest.cpp b/unittests/IR/BasicBlockTest.cpp index f1777e35b82ce..08a41ff369382 100644 --- a/unittests/IR/BasicBlockTest.cpp +++ b/unittests/IR/BasicBlockTest.cpp @@ -33,6 +33,12 @@ TEST(BasicBlockTest, PhiRange) { std::unique_ptr<BasicBlock> 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()); |