summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2015-04-16 15:53:22 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-04-16 15:53:23 +0000
commite7bee3b7d307508243f4a00b5cf8a8867fcaaff5 (patch)
treeb9d350a3d1432d7546e5feab77e25807d328300a /test
parent59bb47675b1f1bafbcababadb4a6ba1c345fec1a (diff)
parenta4f8831d6533e4fe5aed18433099e1130d95a877 (diff)
downloadart-e7bee3b7d307508243f4a00b5cf8a8867fcaaff5.zip
art-e7bee3b7d307508243f4a00b5cf8a8867fcaaff5.tar.gz
art-e7bee3b7d307508243f4a00b5cf8a8867fcaaff5.tar.bz2
Merge "Remove duplicates phis created during SSA transformation"
Diffstat (limited to 'test')
-rw-r--r--test/444-checker-nce/src/Main.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/444-checker-nce/src/Main.java b/test/444-checker-nce/src/Main.java
index 656c791..501d79c 100644
--- a/test/444-checker-nce/src/Main.java
+++ b/test/444-checker-nce/src/Main.java
@@ -251,3 +251,27 @@ public class Main {
}
}
+
+// Regression for when we created and kept equivalent phis with the same type.
+// The phi used in comparison would be different then the one used for access
+// so we could not safely discard it.
+class ListElement {
+ private ListElement next;
+
+ // CHECK-START: boolean ListElement.isShorter(ListElement, ListElement) instruction_simplifier_after_types (before)
+ // CHECK: NullCheck
+ // CHECK: NullCheck
+
+ // CHECK-START: boolean ListElement.isShorter(ListElement, ListElement) instruction_simplifier_after_types (after)
+ // CHECK-NOT: NullCheck
+ static boolean isShorter(ListElement x, ListElement y) {
+ ListElement xTail = x;
+ ListElement yTail = y;
+ while (yTail != null) {
+ if (xTail == null) return true;
+ xTail = xTail.next;
+ yTail = yTail.next;
+ }
+ return false;
+ }
+}