@@ -72,7 +72,8 @@ namespace rsx::assembler
7272 EXPECT_EQ (graph.blocks .size (), 1 );
7373 EXPECT_EQ (graph.blocks .front ().instructions .size (), 2 );
7474 EXPECT_EQ (graph.blocks .front ().instructions .front ().length , 4 );
75- EXPECT_NE (graph.blocks .front ().instructions .front ().addr , 0 );
75+ EXPECT_EQ (graph.blocks .front ().instructions [0 ].addr , 0 );
76+ EXPECT_EQ (graph.blocks .front ().instructions [1 ].addr , 16 );
7677 }
7778
7879 TEST (CFG, FpToCFG_IF)
@@ -192,6 +193,13 @@ namespace rsx::assembler
192193 EXPECT_EQ (std::find_if (graph.blocks .begin (), graph.blocks .end (), FN (x.id == 6 ))->pred [0 ].from ->id , 3 );
193194 EXPECT_EQ (std::find_if (graph.blocks .begin (), graph.blocks .end (), FN (x.id == 6 ))->pred [1 ].type , EdgeType::ENDIF);
194195 EXPECT_EQ (std::find_if (graph.blocks .begin (), graph.blocks .end (), FN (x.id == 6 ))->pred [1 ].from ->id , 0 );
196+
197+ // Successors must also be ordered, closest first
198+ ASSERT_EQ (std::find_if (graph.blocks .begin (), graph.blocks .end (), FN (x.id == 0 ))->succ .size (), 2 );
199+ EXPECT_EQ (std::find_if (graph.blocks .begin (), graph.blocks .end (), FN (x.id == 0 ))->succ [0 ].type , EdgeType::IF);
200+ EXPECT_EQ (std::find_if (graph.blocks .begin (), graph.blocks .end (), FN (x.id == 0 ))->succ [0 ].to ->id , 3 );
201+ EXPECT_EQ (std::find_if (graph.blocks .begin (), graph.blocks .end (), FN (x.id == 0 ))->succ [1 ].type , EdgeType::ENDIF);
202+ EXPECT_EQ (std::find_if (graph.blocks .begin (), graph.blocks .end (), FN (x.id == 0 ))->succ [1 ].to ->id , 6 );
195203 }
196204
197205 TEST (CFG, FpToCFG_IF_ELSE)
0 commit comments