summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <florian.hahn@arm.com>2018-06-18 15:18:48 +0000
committerFlorian Hahn <florian.hahn@arm.com>2018-06-18 15:18:48 +0000
commit63cbcf98a547ed16f89b5c80f7e401849abad3b2 (patch)
treecd708ebd8611d94862dbee58017b8556146afbc6 /llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
parent2272c4811f8d2c56612d483c2546f053e7ea61cc (diff)
downloadbcm5719-llvm-63cbcf98a547ed16f89b5c80f7e401849abad3b2.tar.gz
bcm5719-llvm-63cbcf98a547ed16f89b5c80f7e401849abad3b2.zip
[VPlanRecipeBase] Add eraseFromParent().
Reviewers: dcaballe, hsaito, mkuper, hfinkel Reviewed By: dcaballe Differential Revision: https://reviews.llvm.org/D48081 llvm-svn: 334951
Diffstat (limited to 'llvm/unittests/Transforms/Vectorize/VPlanTest.cpp')
-rw-r--r--llvm/unittests/Transforms/Vectorize/VPlanTest.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp b/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
index 761f7d79664..67712a7cae2 100644
--- a/llvm/unittests/Transforms/Vectorize/VPlanTest.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud