@@ -30,12 +30,14 @@ namespace {
30
30
EXPECT_EQ (&std::get<0 >(Pair), std::get<1 >(Pair)); \
31
31
} while (0 )
32
32
33
- TEST (VPInstructionTest, insertBefore) {
33
+ using VPInstructionTest = VPlanTestBase;
34
+
35
+ TEST_F (VPInstructionTest, insertBefore) {
34
36
VPInstruction *I1 = new VPInstruction (0 , {});
35
37
VPInstruction *I2 = new VPInstruction (1 , {});
36
38
VPInstruction *I3 = new VPInstruction (2 , {});
37
39
38
- VPBasicBlock VPBB1;
40
+ VPBasicBlock & VPBB1 = * getPlan (). createVPBasicBlock ( " " ) ;
39
41
VPBB1.appendRecipe (I1);
40
42
41
43
I2->insertBefore (I1);
@@ -45,12 +47,12 @@ TEST(VPInstructionTest, insertBefore) {
45
47
CHECK_ITERATOR (VPBB1, I3, I2, I1);
46
48
}
47
49
48
- TEST (VPInstructionTest, eraseFromParent) {
50
+ TEST_F (VPInstructionTest, eraseFromParent) {
49
51
VPInstruction *I1 = new VPInstruction (0 , {});
50
52
VPInstruction *I2 = new VPInstruction (1 , {});
51
53
VPInstruction *I3 = new VPInstruction (2 , {});
52
54
53
- VPBasicBlock VPBB1;
55
+ VPBasicBlock & VPBB1 = * getPlan (). createVPBasicBlock ( " " ) ;
54
56
VPBB1.appendRecipe (I1);
55
57
VPBB1.appendRecipe (I2);
56
58
VPBB1.appendRecipe (I3);
@@ -65,12 +67,12 @@ TEST(VPInstructionTest, eraseFromParent) {
65
67
EXPECT_TRUE (VPBB1.empty ());
66
68
}
67
69
68
- TEST (VPInstructionTest, moveAfter) {
70
+ TEST_F (VPInstructionTest, moveAfter) {
69
71
VPInstruction *I1 = new VPInstruction (0 , {});
70
72
VPInstruction *I2 = new VPInstruction (1 , {});
71
73
VPInstruction *I3 = new VPInstruction (2 , {});
72
74
73
- VPBasicBlock VPBB1;
75
+ VPBasicBlock & VPBB1 = * getPlan (). createVPBasicBlock ( " " ) ;
74
76
VPBB1.appendRecipe (I1);
75
77
VPBB1.appendRecipe (I2);
76
78
VPBB1.appendRecipe (I3);
@@ -81,7 +83,7 @@ TEST(VPInstructionTest, moveAfter) {
81
83
82
84
VPInstruction *I4 = new VPInstruction (4 , {});
83
85
VPInstruction *I5 = new VPInstruction (5 , {});
84
- VPBasicBlock VPBB2;
86
+ VPBasicBlock & VPBB2 = * getPlan (). createVPBasicBlock ( " " ) ;
85
87
VPBB2.appendRecipe (I4);
86
88
VPBB2.appendRecipe (I5);
87
89
@@ -92,12 +94,12 @@ TEST(VPInstructionTest, moveAfter) {
92
94
EXPECT_EQ (I3->getParent (), I4->getParent ());
93
95
}
94
96
95
- TEST (VPInstructionTest, moveBefore) {
97
+ TEST_F (VPInstructionTest, moveBefore) {
96
98
VPInstruction *I1 = new VPInstruction (0 , {});
97
99
VPInstruction *I2 = new VPInstruction (1 , {});
98
100
VPInstruction *I3 = new VPInstruction (2 , {});
99
101
100
- VPBasicBlock VPBB1;
102
+ VPBasicBlock & VPBB1 = * getPlan (). createVPBasicBlock ( " " ) ;
101
103
VPBB1.appendRecipe (I1);
102
104
VPBB1.appendRecipe (I2);
103
105
VPBB1.appendRecipe (I3);
@@ -108,7 +110,7 @@ TEST(VPInstructionTest, moveBefore) {
108
110
109
111
VPInstruction *I4 = new VPInstruction (4 , {});
110
112
VPInstruction *I5 = new VPInstruction (5 , {});
111
- VPBasicBlock VPBB2;
113
+ VPBasicBlock & VPBB2 = * getPlan (). createVPBasicBlock ( " " ) ;
112
114
VPBB2.appendRecipe (I4);
113
115
VPBB2.appendRecipe (I5);
114
116
@@ -118,7 +120,7 @@ TEST(VPInstructionTest, moveBefore) {
118
120
CHECK_ITERATOR (VPBB2, I3, I4, I5);
119
121
EXPECT_EQ (I3->getParent (), I4->getParent ());
120
122
121
- VPBasicBlock VPBB3;
123
+ VPBasicBlock & VPBB3 = * getPlan (). createVPBasicBlock ( " " ) ;
122
124
123
125
I4->moveBefore (VPBB3, VPBB3.end ());
124
126
@@ -128,7 +130,7 @@ TEST(VPInstructionTest, moveBefore) {
128
130
EXPECT_EQ (&VPBB3, I4->getParent ());
129
131
}
130
132
131
- TEST (VPInstructionTest, setOperand) {
133
+ TEST_F (VPInstructionTest, setOperand) {
132
134
VPValue *VPV1 = new VPValue ();
133
135
VPValue *VPV2 = new VPValue ();
134
136
VPInstruction *I1 = new VPInstruction (0 , {VPV1, VPV2});
@@ -174,7 +176,7 @@ TEST(VPInstructionTest, setOperand) {
174
176
delete VPV4;
175
177
}
176
178
177
- TEST (VPInstructionTest, replaceAllUsesWith) {
179
+ TEST_F (VPInstructionTest, replaceAllUsesWith) {
178
180
VPValue *VPV1 = new VPValue ();
179
181
VPValue *VPV2 = new VPValue ();
180
182
VPInstruction *I1 = new VPInstruction (0 , {VPV1, VPV2});
@@ -220,7 +222,7 @@ TEST(VPInstructionTest, replaceAllUsesWith) {
220
222
delete VPV3;
221
223
}
222
224
223
- TEST (VPInstructionTest, releaseOperandsAtDeletion) {
225
+ TEST_F (VPInstructionTest, releaseOperandsAtDeletion) {
224
226
VPValue *VPV1 = new VPValue ();
225
227
VPValue *VPV2 = new VPValue ();
226
228
VPInstruction *I1 = new VPInstruction (0 , {VPV1, VPV2});
0 commit comments