summaryrefslogtreecommitdiff
path: root/src/test/java/com/seaofnodes/simple/Chapter05Test.java
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-08-10 11:11:18 -0700
committerCliff Click <cliffc@acm.org>2026-08-10 15:21:17 -0700
commit28209703c72fb7e9955961dbdb84e24a0f871acd (patch)
tree8e4df2c1a5e6811696b454bbc4d7cd1cc30e42e7 /src/test/java/com/seaofnodes/simple/Chapter05Test.java
parente57bdd315a7918a0d130e1c95648ca4a1b4f08ed (diff)
downloadSimple-linear-chapter25.tar.gz
Simple-linear-chapter25.zip
Chapter 25: Moduleslinear-chapter25
Diffstat (limited to 'src/test/java/com/seaofnodes/simple/Chapter05Test.java')
-rw-r--r--src/test/java/com/seaofnodes/simple/Chapter05Test.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/test/java/com/seaofnodes/simple/Chapter05Test.java b/src/test/java/com/seaofnodes/simple/Chapter05Test.java
index d1dfd216..6ac08fda 100644
--- a/src/test/java/com/seaofnodes/simple/Chapter05Test.java
+++ b/src/test/java/com/seaofnodes/simple/Chapter05Test.java
@@ -116,7 +116,10 @@ if( arg==0 )
return arg+a+b;
""");
code.parse().opto();
- assertEquals("return ((arg+Phi(Region,1,0))+Phi(Region,2,0));", code.print());
+ String ir = code.print();
+ assertTrue(ir,
+ ir.equals("return ((arg+Phi(Region,1,0))+Phi(Region,2,0));") ||
+ ir.equals("return (Phi(Region,((!=0)arg+1),0)+Phi(Region,2,0));"));
}
@Test
@@ -162,7 +165,7 @@ return a;
@Test
public void testBadNum() {
try { new CodeGen("return 1-;").parse(); fail(); }
- catch( RuntimeException e ) { assertEquals("Syntax error, expected an identifier or expression: ;",e.getMessage()); }
+ catch( RuntimeException e ) { assertEquals("Syntax error, expected `an identifier or expression` but found `;`",e.getMessage()); }
}
@Test