summaryrefslogtreecommitdiff
path: root/src/test/java/com/seaofnodes/simple/Chapter05Test.java
diff options
context:
space:
mode:
authorThalia Archibald <thalia@archibald.dev>2024-03-03 17:55:47 +0000
committerThalia Archibald <thalia@archibald.dev>2024-10-23 17:51:09 -0700
commit9ed409df4516e0089afbc7d5ccf9b029d431be04 (patch)
treec0ae90716b9551dc0e58d0ec52f5e4e91bb1152f /src/test/java/com/seaofnodes/simple/Chapter05Test.java
parent425f05826799e9da06a630187d2ad05c656266a1 (diff)
downloadSimple-linear-chapter09.tar.gz
Simple-linear-chapter09.zip
Chapter 9: Global Value Numbering and Iterative Peepholeslinear-chapter09
Co-authored-by: Cliff Click <cliffc@acm.org> Co-authored-by: XmiliaH <45106915+XmiliaH@users.noreply.github.com> Co-authored-by: Robert Obkircher <robert.obkircher@gmail.com> Co-authored-by: Dibyendu Majumdar <mobile@majumdar.org.uk> Co-authored-by: Darrick Wiebe <darrickw@untether.ai>
Diffstat (limited to 'src/test/java/com/seaofnodes/simple/Chapter05Test.java')
-rw-r--r--src/test/java/com/seaofnodes/simple/Chapter05Test.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/test/java/com/seaofnodes/simple/Chapter05Test.java b/src/test/java/com/seaofnodes/simple/Chapter05Test.java
index 68d379a1..6ad3af15 100644
--- a/src/test/java/com/seaofnodes/simple/Chapter05Test.java
+++ b/src/test/java/com/seaofnodes/simple/Chapter05Test.java
@@ -21,7 +21,7 @@ else {
}
return a;""");
- StopNode ret = parser.parse();
+ StopNode ret = parser.parse().iterate();
assertEquals("return Phi(Region17,(arg+2),(arg-3));", ret.toString());
}
@@ -36,7 +36,7 @@ if (arg == 1) {
c = 4;
}
return c;""", TypeInteger.BOT);
- StopNode ret = parser.parse();
+ StopNode ret = parser.parse().iterate();
assertEquals("return Phi(Region16,4,3);", ret.toString());
}
@@ -64,7 +64,7 @@ if( arg==1 )
else
b=a+1;
return a+b;""");
- StopNode ret = parser.parse();
+ StopNode ret = parser.parse().iterate();
assertEquals("return ((arg*2)+Phi(Region20,2,3));", ret.toString());
}
@@ -79,7 +79,7 @@ if( arg==1 )
else
a=b+1;
return a+b;""");
- StopNode ret = parser.parse();
+ StopNode ret = parser.parse().iterate();
assertEquals("return ((Phi(Region31,(arg*2),arg)+arg)+Phi(Region,4,5));", ret.toString());
}
@@ -99,7 +99,7 @@ else
a=5;
return a;
""", TypeInteger.BOT);
- StopNode stop = parser.parse();
+ StopNode stop = parser.parse().iterate();
assertEquals("return Phi(Region33,Phi(Region21,2,3),Phi(Region31,4,5));", stop.toString());
}
@@ -129,7 +129,7 @@ if( arg==1 )
a=arg==3;
}
return a;""");
- StopNode ret = parser.parse();
+ StopNode ret = parser.parse().iterate();
assertEquals("return (arg==Phi(Region16,3,2));", ret.toString());
}
@@ -169,6 +169,7 @@ return a;""");
}
}
+
@Test
public void testBadNum() {
try {