diff options
author | Florian Hahn <florian.hahn@arm.com> | 2018-06-18 15:18:48 +0000 |
---|---|---|
committer | Florian Hahn <florian.hahn@arm.com> | 2018-06-18 15:18:48 +0000 |
commit | 11952d0f055dc00412a3e8f862eb304c3d09510d (patch) | |
tree | b6aa1d52b6465c5f883909a84e12199c34f6d386 /unittests/Transforms | |
parent | 3e3bddcaee13d9da364bf8fa0ae61d95e5115ed3 (diff) |
[VPlanRecipeBase] Add eraseFromParent().
Reviewers: dcaballe, hsaito, mkuper, hfinkel
Reviewed By: dcaballe
Differential Revision: https://reviews.llvm.org/D48081
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334951 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Transforms')
-rw-r--r-- | unittests/Transforms/Vectorize/VPlanTest.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/unittests/Transforms/Vectorize/VPlanTest.cpp b/unittests/Transforms/Vectorize/VPlanTest.cpp index 761f7d79664..67712a7cae2 100644 --- a/unittests/Transforms/Vectorize/VPlanTest.cpp +++ b/unittests/Transforms/Vectorize/VPlanTest.cpp @@ -40,5 +40,25 @@ TEST(VPInstructionTest, insertBefore) { CHECK_ITERATOR(VPBB1, I3, I2, I1); } +TEST(VPInstructionTest, eraseFromParent) { + VPInstruction *I1 = new VPInstruction(0, {}); + VPInstruction *I2 = new VPInstruction(1, {}); + VPInstruction *I3 = new VPInstruction(2, {}); + + VPBasicBlock VPBB1; + VPBB1.appendRecipe(I1); + VPBB1.appendRecipe(I2); + VPBB1.appendRecipe(I3); + + I2->eraseFromParent(); + CHECK_ITERATOR(VPBB1, I1, I3); + + I1->eraseFromParent(); + CHECK_ITERATOR(VPBB1, I3); + + I3->eraseFromParent(); + EXPECT_TRUE(VPBB1.empty()); +} + } // namespace } // namespace llvm |