summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorCalin Juravle <calin@google.com>2015-02-24 12:39:53 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-02-24 12:39:54 +0000
commit2d043b356d2e5c911892badf78aa56b843c5c3a6 (patch)
tree0d00c6118ecc251f7b4af0631308e6ef2104d6ad /test
parent0b6daeb0f0014474b542cbba1f713eb0dbefb7f9 (diff)
parent61d544bfb812d79f5c9ddad171198836cea719db (diff)
downloadart-2d043b356d2e5c911892badf78aa56b843c5c3a6.tar.gz
art-2d043b356d2e5c911892badf78aa56b843c5c3a6.tar.bz2
art-2d043b356d2e5c911892badf78aa56b843c5c3a6.zip
Merge "[optimizing] Add if-context sensitivity for null popagation."
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 9fb9c4668b..656c7916fd 100644
--- a/test/444-checker-nce/src/Main.java
+++ b/test/444-checker-nce/src/Main.java
@@ -214,6 +214,30 @@ public class Main {
return m;
}
+ // CHECK-START: Main Main.scopeIfNotNullRemove(Main) instruction_simplifier_after_types (before)
+ // CHECK: NullCheck
+
+ // CHECK-START: Main Main.scopeIfNotNullRemove(Main) instruction_simplifier_after_types (after)
+ // CHECK-NOT: NullCheck
+ public Main scopeIfNotNullRemove(Main m) {
+ if (m != null) {
+ return m.g();
+ }
+ return m;
+ }
+
+ // CHECK-START: Main Main.scopeIfKeep(Main) instruction_simplifier_after_types (before)
+ // CHECK: NullCheck
+
+ // CHECK-START: Main Main.scopeIfKeep(Main) instruction_simplifier_after_types (after)
+ // CHECK: NullCheck
+ public Main scopeIfKeep(Main m) {
+ if (m == null) {
+ m = new Main();
+ }
+ return m.g();
+ }
+
public Main() {}
public Main(int dummy) {}