15TEST(StaticSingleAssignmentDestructionTests, test_two_phis)
24 auto bb1 = BasicBlock::create(cfg);
25 auto bb2 = BasicBlock::create(cfg);
26 auto bb3 = BasicBlock::create(cfg);
27 auto bb4 = BasicBlock::create(cfg);
30 bb1->add_outedge(bb2);
31 bb1->add_outedge(bb3);
32 bb2->add_outedge(bb4);
33 bb3->add_outedge(bb4);
34 bb4->add_outedge(cfg.
exit());
36 bb2->append_last(ThreeAddressCode::create(TestOperation::create({}, {
vt }), {}));
37 auto v1 = bb2->last()->result(0);
39 bb2->append_last(ThreeAddressCode::create(TestOperation::create({}, {
vt }), {}));
40 auto v3 = bb2->last()->result(0);
42 bb3->append_last(ThreeAddressCode::create(TestOperation::create({}, {
vt }), {}));
43 auto v2 = bb3->last()->result(0);
45 bb3->append_last(ThreeAddressCode::create(TestOperation::create({}, {
vt }), {}));
46 auto v4 = bb3->last()->result(0);
48 bb4->append_last(SsaPhiOperation::create({ { v1, bb2 }, { v2, bb3 } },
vt));
49 bb4->append_last(SsaPhiOperation::create({ { v3, bb2 }, { v4, bb3 } },
vt));
51 std::cout << ControlFlowGraph::ToAscii(cfg) << std::flush;
55 std::cout << ControlFlowGraph::ToAscii(cfg) << std::flush;