diff options
author | Calin Juravle <calin@google.com> | 2015-04-16 15:53:22 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-04-16 15:53:23 +0000 |
commit | e7bee3b7d307508243f4a00b5cf8a8867fcaaff5 (patch) | |
tree | b9d350a3d1432d7546e5feab77e25807d328300a /test | |
parent | 59bb47675b1f1bafbcababadb4a6ba1c345fec1a (diff) | |
parent | a4f8831d6533e4fe5aed18433099e1130d95a877 (diff) | |
download | art-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.java | 24 |
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; + } +} |