diff options
| author | Cliff Click <cliffc@acm.org> | 2023-10-28 15:48:12 -0700 |
|---|---|---|
| committer | Dibyendu Majumdar <dibyendumajumdar@users.noreply.github.com> | 2023-11-01 18:56:50 +0000 |
| commit | ef8db9b6acaf372824961df6d1008965cc9553be (patch) | |
| tree | b4bd0818b3920cffe591a847f83122ba00399fb3 /chapter05/src/test/java/com | |
| parent | d8405f46790d85f5d18f8b04dbd4fd8116af08ea (diff) | |
| download | Simple-ef8db9b6acaf372824961df6d1008965cc9553be.tar.gz Simple-ef8db9b6acaf372824961df6d1008965cc9553be.zip | |
Fix Scope.dup mixing up edge orders
Fix GraphVix node edge ordering
Diffstat (limited to 'chapter05/src/test/java/com')
| -rw-r--r-- | chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java b/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java index 260c9b04..496b3ff5 100644 --- a/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java +++ b/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java @@ -26,7 +26,22 @@ return a; ReturnNode ret = parser.parse(); assertEquals("return Phi(Region16,(arg4+2),(arg4-3));", ret.toString()); } - + + @Test + public void testChapter5Test() { + Parser parser = new Parser(""" +int c = 3; +int b = 2; +if (arg == 1) { + b = 3; + c = 4; +} +return c; + """, TypeInteger.BOT); + ReturnNode ret = parser.parse(); + assertEquals("return Phi(Region15,4,3);", ret.toString()); + } + @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;"); |
