ASSERT_EQ(ins_2->prev(), ins_1);
ASSERT_EQ(ins_2->next(), nullptr);
}
+
+TEST(IR_MODULE, iterate_constant_block)
+{
+ auto m = coco::Module::create();
+ auto blk = m->entity()->block()->create();
+ auto ins_1 = m->entity()->instr()->create<coco::UnitF>();
+ auto ins_2 = m->entity()->instr()->create<coco::UnitF>();
+
+ blk->instr()->append(ins_1);
+ blk->instr()->append(ins_2);
+
+ const coco::Block *immutable_blk = blk;
+
+ ASSERT_EQ(blk->instr()->head(), ins_1);
+ ASSERT_EQ(blk->instr()->head()->next(), ins_2);
+}