@@ -30,12 +30,14 @@ namespace {
3030 EXPECT_EQ (&std::get<0 >(Pair), std::get<1 >(Pair)); \
3131 } while (0 )
3232
33- TEST (VPInstructionTest, insertBefore) {
33+ using VPInstructionTest = VPlanTestBase;
34+
35+ TEST_F (VPInstructionTest, insertBefore) {
3436 VPInstruction *I1 = new VPInstruction (0 , {});
3537 VPInstruction *I2 = new VPInstruction (1 , {});
3638 VPInstruction *I3 = new VPInstruction (2 , {});
3739
38- VPBasicBlock VPBB1;
40+ VPBasicBlock & VPBB1 = * getPlan (). createVPBasicBlock ( " " ) ;
3941 VPBB1.appendRecipe (I1);
4042
4143 I2->insertBefore (I1);
@@ -45,12 +47,12 @@ TEST(VPInstructionTest, insertBefore) {
4547 CHECK_ITERATOR (VPBB1, I3, I2, I1);
4648}
4749
48- TEST (VPInstructionTest, eraseFromParent) {
50+ TEST_F (VPInstructionTest, eraseFromParent) {
4951 VPInstruction *I1 = new VPInstruction (0 , {});
5052 VPInstruction *I2 = new VPInstruction (1 , {});
5153 VPInstruction *I3 = new VPInstruction (2 , {});
5254
53- VPBasicBlock VPBB1;
55+ VPBasicBlock & VPBB1 = * getPlan (). createVPBasicBlock ( " " ) ;
5456 VPBB1.appendRecipe (I1);
5557 VPBB1.appendRecipe (I2);
5658 VPBB1.appendRecipe (I3);
@@ -65,12 +67,12 @@ TEST(VPInstructionTest, eraseFromParent) {
6567 EXPECT_TRUE (VPBB1.empty ());
6668}
6769
68- TEST (VPInstructionTest, moveAfter) {
70+ TEST_F (VPInstructionTest, moveAfter) {
6971 VPInstruction *I1 = new VPInstruction (0 , {});
7072 VPInstruction *I2 = new VPInstruction (1 , {});
7173 VPInstruction *I3 = new VPInstruction (2 , {});
7274
73- VPBasicBlock VPBB1;
75+ VPBasicBlock & VPBB1 = * getPlan (). createVPBasicBlock ( " " ) ;
7476 VPBB1.appendRecipe (I1);
7577 VPBB1.appendRecipe (I2);
7678 VPBB1.appendRecipe (I3);
@@ -81,7 +83,7 @@ TEST(VPInstructionTest, moveAfter) {
8183
8284 VPInstruction *I4 = new VPInstruction (4 , {});
8385 VPInstruction *I5 = new VPInstruction (5 , {});
84- VPBasicBlock VPBB2;
86+ VPBasicBlock & VPBB2 = * getPlan (). createVPBasicBlock ( " " ) ;
8587 VPBB2.appendRecipe (I4);
8688 VPBB2.appendRecipe (I5);
8789
@@ -92,12 +94,12 @@ TEST(VPInstructionTest, moveAfter) {
9294 EXPECT_EQ (I3->getParent (), I4->getParent ());
9395}
9496
95- TEST (VPInstructionTest, moveBefore) {
97+ TEST_F (VPInstructionTest, moveBefore) {
9698 VPInstruction *I1 = new VPInstruction (0 , {});
9799 VPInstruction *I2 = new VPInstruction (1 , {});
98100 VPInstruction *I3 = new VPInstruction (2 , {});
99101
100- VPBasicBlock VPBB1;
102+ VPBasicBlock & VPBB1 = * getPlan (). createVPBasicBlock ( " " ) ;
101103 VPBB1.appendRecipe (I1);
102104 VPBB1.appendRecipe (I2);
103105 VPBB1.appendRecipe (I3);
@@ -108,7 +110,7 @@ TEST(VPInstructionTest, moveBefore) {
108110
109111 VPInstruction *I4 = new VPInstruction (4 , {});
110112 VPInstruction *I5 = new VPInstruction (5 , {});
111- VPBasicBlock VPBB2;
113+ VPBasicBlock & VPBB2 = * getPlan (). createVPBasicBlock ( " " ) ;
112114 VPBB2.appendRecipe (I4);
113115 VPBB2.appendRecipe (I5);
114116
@@ -118,7 +120,7 @@ TEST(VPInstructionTest, moveBefore) {
118120 CHECK_ITERATOR (VPBB2, I3, I4, I5);
119121 EXPECT_EQ (I3->getParent (), I4->getParent ());
120122
121- VPBasicBlock VPBB3;
123+ VPBasicBlock & VPBB3 = * getPlan (). createVPBasicBlock ( " " ) ;
122124
123125 I4->moveBefore (VPBB3, VPBB3.end ());
124126
@@ -128,7 +130,7 @@ TEST(VPInstructionTest, moveBefore) {
128130 EXPECT_EQ (&VPBB3, I4->getParent ());
129131}
130132
131- TEST (VPInstructionTest, setOperand) {
133+ TEST_F (VPInstructionTest, setOperand) {
132134 VPValue *VPV1 = new VPValue ();
133135 VPValue *VPV2 = new VPValue ();
134136 VPInstruction *I1 = new VPInstruction (0 , {VPV1, VPV2});
@@ -174,7 +176,7 @@ TEST(VPInstructionTest, setOperand) {
174176 delete VPV4;
175177}
176178
177- TEST (VPInstructionTest, replaceAllUsesWith) {
179+ TEST_F (VPInstructionTest, replaceAllUsesWith) {
178180 VPValue *VPV1 = new VPValue ();
179181 VPValue *VPV2 = new VPValue ();
180182 VPInstruction *I1 = new VPInstruction (0 , {VPV1, VPV2});
@@ -220,7 +222,7 @@ TEST(VPInstructionTest, replaceAllUsesWith) {
220222 delete VPV3;
221223}
222224
223- TEST (VPInstructionTest, releaseOperandsAtDeletion) {
225+ TEST_F (VPInstructionTest, releaseOperandsAtDeletion) {
224226 VPValue *VPV1 = new VPValue ();
225227 VPValue *VPV2 = new VPValue ();
226228 VPInstruction *I1 = new VPInstruction (0 , {VPV1, VPV2});
0 commit comments