From bb76f85f0e2d1f2c47443143e0b96d608be7820d Mon Sep 17 00:00:00 2001 From: dibyendumajumdar Date: Fri, 27 Oct 2023 23:15:48 +0100 Subject: Added PhiNode, RegionNode, IfNode, StopNode No type compute yet Initial parsing logic for If statements --- chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'chapter05/src/test/java') diff --git a/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java b/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java index 4106ef3b..858e2470 100644 --- a/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java +++ b/chapter05/src/test/java/com/seaofnodes/simple/Chapter05Test.java @@ -13,6 +13,13 @@ public class Chapter05Test { @Rule public ExpectedException exceptionRule = ExpectedException.none(); + @Test + public void testChapter5IfStmt() { + Parser parser = new Parser("int a = 1; if (arg == 1) a = arg+2; else a = arg-3; return a;", TypeInteger.BOT); + ReturnNode ret = parser.parse(); + } + + @Test public void testChapter4Peephole() { Parser parser = new Parser("return 1+arg+2; #showGraph;", TypeInteger.BOT); -- cgit v1.2.3