From c7a3752481c3c33cc7e460a75daf2a07d2c15c25 Mon Sep 17 00:00:00 2001 From: XmiliaH <45106915+XmiliaH@users.noreply.github.com> Date: Sat, 28 Oct 2023 23:37:22 +0200 Subject: set_def might kill new_def in kill recursion caused by old_def being killed (#18) --- chapter04/src/test/java/com/seaofnodes/simple/Chapter04Test.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'chapter04/src/test') diff --git a/chapter04/src/test/java/com/seaofnodes/simple/Chapter04Test.java b/chapter04/src/test/java/com/seaofnodes/simple/Chapter04Test.java index 8cc78af0..4782e568 100644 --- a/chapter04/src/test/java/com/seaofnodes/simple/Chapter04Test.java +++ b/chapter04/src/test/java/com/seaofnodes/simple/Chapter04Test.java @@ -112,6 +112,13 @@ public class Chapter04Test { assertEquals("return (Proj_3+1);", ret.print()); } + @Test + public void testChapter4Bug3() { + Parser parser = new Parser("int a=arg*2+1; a=a+-1; return a; #showGraph;", TypeInteger.BOT); + ReturnNode ret = parser.parse(); + assertEquals("return (Proj_3*2);", ret.print()); + } + @Test public void testVarDecl() { Parser parser = new Parser("int a=1; return a;"); -- cgit v1.2.3