summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2015-07-02 15:48:27 +0100
committerNicolas Geoffray <ngeoffray@google.com>2015-07-02 15:58:52 +0100
commit3abd437507f8ba30a238a52c273c9944dcb9d5a1 (patch)
tree9e058e63cb1176446a2838436223d8b18119a2b0 /test
parent4990f5c14a04b9aad1be50d206b7c1f8989d8923 (diff)
downloadart-3abd437507f8ba30a238a52c273c9944dcb9d5a1.zip
art-3abd437507f8ba30a238a52c273c9944dcb9d5a1.tar.gz
art-3abd437507f8ba30a238a52c273c9944dcb9d5a1.tar.bz2
Do not create a HBoundType when the instruction is non-null.
We don't need to refine the type after a null check, if the instruction is known non null or null. As a side effect, this avoids replacing HLoadClass instructions with HBoundType instructions. bug:22116987 Change-Id: I565ae95db5a64faec30e026674636e398e0bf445
Diffstat (limited to 'test')
-rw-r--r--test/519-bound-load-class/src/Main.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/519-bound-load-class/src/Main.java b/test/519-bound-load-class/src/Main.java
index 41bb951..cddeb09 100644
--- a/test/519-bound-load-class/src/Main.java
+++ b/test/519-bound-load-class/src/Main.java
@@ -16,9 +16,24 @@
public class Main {
public static void main(String[] args) {
+ testInstanceOf();
+ try {
+ testNull();
+ throw new Error("Expected ClassClastException");
+ } catch (ClassCastException e) { /* ignore */ }
+ }
+
+ public static void testInstanceOf() {
Object o = Main.class;
if (o instanceof Main) {
System.out.println((Main)o);
}
}
+
+ public static void testNull() {
+ Object o = Main.class;
+ if (o != null) {
+ System.out.println((Main)o);
+ }
+ }
}