changeset 15536:d897375b372a

SimpleCFGTest: check postOrder().
author Josef Eisl <josef.eisl@jku.at>
date Thu, 24 Apr 2014 13:38:14 +0200
parents 706bb8271128
children 8117e9cadb48
files graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/SimpleCFGTest.java
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/SimpleCFGTest.java	Thu Apr 24 09:55:28 2014 +0200
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/SimpleCFGTest.java	Thu Apr 24 13:38:14 2014 +0200
@@ -22,6 +22,10 @@
  */
 package com.oracle.graal.compiler.test;
 
+import static org.junit.Assert.assertTrue;
+
+import java.util.*;
+
 import org.junit.*;
 
 import com.oracle.graal.debug.*;
@@ -73,6 +77,14 @@
         assertEquals(blocks[3], cfg.blockFor(merge));
         assertEquals(blocks[3], cfg.blockFor(returnNode));
 
+        // check postOrder
+        Iterator<Block> it = cfg.postOrder().iterator();
+        for (int i = blocks.length - 1; i >= 0; i--) {
+            assertTrue(it.hasNext());
+            Block b = it.next();
+            assertEquals(blocks[i], b);
+        }
+
         // check dominators
         assertDominator(blocks[0], null);
         assertDominator(blocks[1], blocks[0]);