summaryrefslogtreecommitdiff
path: root/chapter05/src/test/java/com
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2023-10-30 10:15:49 -0700
committerDibyendu Majumdar <dibyendumajumdar@users.noreply.github.com>2023-11-01 18:56:50 +0000
commit7aca34858eb886677bc179658a6fffbb5ae54f66 (patch)
tree72b58e82eb05bbc43f8589bcfd9caf31d9c08909 /chapter05/src/test/java/com
parent4410e4e3d7a4b9e0424de7678633e2a7240695cd (diff)
downloadSimple-7aca34858eb886677bc179658a6fffbb5ae54f66.tar.gz
Simple-7aca34858eb886677bc179658a6fffbb5ae54f66.zip
Lots of improvements to graphviz
Merging common edges. Phis of same Region align. Phis use greek phi, and have a debug name. Scope carries the debug name. Phis are lightly colored. Common math names for math prims. Parse can optionally show the graph after closing the last scope.
Diffstat (limited to 'chapter05/src/test/java/com')
-rw-r--r--chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java b/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java
index a4bf89ec..cd350db5 100644
--- a/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java
+++ b/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java
@@ -51,15 +51,15 @@ return c;
@Test
public void testChapter5IfMergeB() {
- Parser parser = new Parser("int a=arg+1; int b=0; if( arg==1 ) b=a; else b=a+1; return a+b; #showGraph;");
- StopNode ret = parser.parse();
+ Parser parser = new Parser("int a=arg+1; int b=0; if( arg==1 ) b=a; else b=a+1; return a+b;");
+ StopNode ret = parser.parse(true);
assertEquals("return ((arg*2)+Phi(Region20,2,3));", ret.toString());
}
@Test
public void testChapter5IfMerge2() {
- Parser parser = new Parser("int a=arg+1; int b=arg+2; if( arg==1 ) b=b+a; else a=b+1; return a+b; #showGraph;");
- StopNode ret = parser.parse();
+ Parser parser = new Parser("int a=arg+1; int b=arg+2; if( arg==1 ) b=b+a; else a=b+1; return a+b;");
+ StopNode ret = parser.parse(true);
assertEquals("return ((Phi(Region31,(arg*2),arg)+arg)+Phi(Region31,4,5));", ret.toString());
}