summaryrefslogtreecommitdiff
path: root/chapter10b/src
diff options
context:
space:
mode:
authorCliff Click <cliffc@acm.org>2026-09-30 22:15:41 -0700
committerCliff Click <cliffc@acm.org>2026-09-30 22:15:41 -0700
commit5e3dc0a228cfe7c0c15f3d94d8d6a45e4704787a (patch)
tree19050f94fb5bdfbc0d51f6aae0c45af0fae83acf /chapter10b/src
parentc4dcf6f751b35c7a2a3b46fa2d69b95d37d082a6 (diff)
parent23481970c0115bf86f08c89b3916285b78311b8d (diff)
downloadSimple-5e3dc0a228cfe7c0c15f3d94d8d6a45e4704787a.tar.gz
Simple-5e3dc0a228cfe7c0c15f3d94d8d6a45e4704787a.zip
Merge pull request #258: same constant phi merge test
Preserve the regression across the Chapter 10 split by including it in both chapter10a and chapter10b. Validated Chapter05Test in all 22 affected snapshots (374 tests).
Diffstat (limited to 'chapter10b/src')
-rw-r--r--chapter10b/src/test/java/com/seaofnodes/simple/Chapter05Test.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/chapter10b/src/test/java/com/seaofnodes/simple/Chapter05Test.java b/chapter10b/src/test/java/com/seaofnodes/simple/Chapter05Test.java
index aefb3a5c..cf7bd6cf 100644
--- a/chapter10b/src/test/java/com/seaofnodes/simple/Chapter05Test.java
+++ b/chapter10b/src/test/java/com/seaofnodes/simple/Chapter05Test.java
@@ -134,6 +134,21 @@ return a;""");
}
@Test
+ public void testMergeSameCon() {
+ Parser parser = new Parser(
+"""
+int a=arg;
+if( arg==1 )
+ a=3;
+else
+ a=3;
+return a;
+""");
+ StopNode ret = parser.parse();
+ assertEquals("return 3;", ret.toString());
+ }
+
+ @Test
public void testTrue() {
StopNode stop = new Parser("return true;").parse();
assertEquals("return 1;",stop.toString());