コード例 #1
0
 @Test
 public void testLoop9() {
   ScheduleResult schedule = getFinalSchedule("testLoop9Snippet", TestMode.WITHOUT_FRAMESTATES);
   StructuredGraph graph = schedule.getCFG().getStartBlock().getBeginNode().graph();
   assertThat(graph.getNodes(ReturnNode.TYPE), hasCount(1));
   ReturnNode ret = graph.getNodes(ReturnNode.TYPE).first();
   assertThat(ret.result(), instanceOf(FloatingReadNode.class));
   Block readBlock = schedule.getNodeToBlockMap().get(ret.result());
   Assert.assertEquals(0, readBlock.getLoopDepth());
 }
コード例 #2
0
 @Test
 public void testArrayCopy() {
   ScheduleResult schedule =
       getFinalSchedule("testArrayCopySnippet", TestMode.INLINED_WITHOUT_FRAMESTATES);
   StructuredGraph graph = schedule.getCFG().getStartBlock().getBeginNode().graph();
   assertDeepEquals(1, graph.getNodes(ReturnNode.TYPE).count());
   ReturnNode ret = graph.getNodes(ReturnNode.TYPE).first();
   assertTrue(
       ret.result() + " should be a FloatingReadNode", ret.result() instanceof FloatingReadNode);
   assertDeepEquals(schedule.getCFG().blockFor(ret), schedule.getCFG().blockFor(ret.result()));
   assertReadWithinAllReturnBlocks(schedule, true);
 }