@@ -17,6 +17,12 @@ TEST(LLVMInstructionListTest, EmptyList_Last)
17
17
ASSERT_EQ (list.last (), nullptr );
18
18
}
19
19
20
+ TEST (LLVMInstructionListTest, EmptyList_Empty)
21
+ {
22
+ LLVMInstructionList list;
23
+ ASSERT_TRUE (list.empty ());
24
+ }
25
+
20
26
TEST (LLVMInstructionListTest, EmptyList_ContainsNull)
21
27
{
22
28
LLVMInstructionList list;
@@ -188,6 +194,15 @@ TEST(LLVMInstructionListTest, AddSingleInstruction_Last)
188
194
ASSERT_EQ (list.last (), ins.get ());
189
195
}
190
196
197
+ TEST (LLVMInstructionListTest, AddSingleInstruction_Empty)
198
+ {
199
+ LLVMInstructionList list;
200
+ auto ins = std::make_shared<LLVMInstruction>(LLVMInstruction::Type::FunctionCall, nullptr , false );
201
+ list.addInstruction (ins);
202
+
203
+ ASSERT_FALSE (list.empty ());
204
+ }
205
+
191
206
TEST (LLVMInstructionListTest, AddSingleInstruction_Previous)
192
207
{
193
208
LLVMInstructionList list;
@@ -238,6 +253,22 @@ TEST(LLVMInstructionListTest, AddMultipleInstructions_Last)
238
253
ASSERT_EQ (list.last (), ins3.get ());
239
254
}
240
255
256
+ TEST (LLVMInstructionListTest, AddMultipleInstructions_Empty)
257
+ {
258
+ LLVMInstructionList list;
259
+
260
+ auto ins1 = std::make_shared<LLVMInstruction>(LLVMInstruction::Type::FunctionCall, nullptr , false );
261
+ list.addInstruction (ins1);
262
+
263
+ auto ins2 = std::make_shared<LLVMInstruction>(LLVMInstruction::Type::FunctionCall, nullptr , false );
264
+ list.addInstruction (ins2);
265
+
266
+ auto ins3 = std::make_shared<LLVMInstruction>(LLVMInstruction::Type::FunctionCall, nullptr , false );
267
+ list.addInstruction (ins3);
268
+
269
+ ASSERT_FALSE (list.empty ());
270
+ }
271
+
241
272
TEST (LLVMInstructionListTest, AddMultipleInstructions_PreviousOfFirst)
242
273
{
243
274
LLVMInstructionList list;
0 commit comments