Revert "ART-tests: Remove DX dependency from 450-checker-types."
This reverts commit 1500bc6bdbdad3b0f88eaafda82d017c33525c1c.
Reason for revert: Move test back to Java. It works fine
with the current version of D8.
Test: testrunner.py --host --optimizing --jvm -t 450
Bug: 65168732
Bug: 73888836
Change-Id: Ice55e9c47c31d7e4ca47339b785bb21a05ef5cba
diff --git a/test/450-checker-types/smali/Main2.smali b/test/450-checker-types/smali/Main2.smali
deleted file mode 100644
index 5f11be3..0000000
--- a/test/450-checker-types/smali/Main2.smali
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 2018 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-.class LMain2;
-.super Ljava/lang/Object;
-.source "Main2.java"
-
-
-# direct methods
-.method constructor <init>()V
- .registers 1
-
- .prologue
- .line 17
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
-
- return-void
-.end method
-
-## CHECK-START: void Main2.testArraySimpleRemove() instruction_simplifier (before)
-## CHECK: CheckCast
-
-## CHECK-START: void Main2.testArraySimpleRemove() instruction_simplifier (after)
-## CHECK-NOT: CheckCast
-
-.method static testArraySimpleRemove()V
- .registers 3
-
- .prologue
- .line 19
- const/16 v2, 0xa
-
- new-array v0, v2, [LSubclassA;
-
- .local v0, "b":[LSuper;
- move-object v1, v0
-
- .line 20
- check-cast v1, [LSubclassA;
-
- .line 21
- .local v1, "c":[LSubclassA;
- return-void
-.end method
diff --git a/test/450-checker-types/src/Main.java b/test/450-checker-types/src/Main.java
index 2351c23..9e3f951 100644
--- a/test/450-checker-types/src/Main.java
+++ b/test/450-checker-types/src/Main.java
@@ -463,6 +463,16 @@
public SubclassA $noinline$getSubclass() { throw new RuntimeException(); }
+ /// CHECK-START: void Main.testArraySimpleRemove() instruction_simplifier (before)
+ /// CHECK: CheckCast
+
+ /// CHECK-START: void Main.testArraySimpleRemove() instruction_simplifier (after)
+ /// CHECK-NOT: CheckCast
+ public void testArraySimpleRemove() {
+ Super[] b = new SubclassA[10];
+ SubclassA[] c = (SubclassA[])b;
+ }
+
/// CHECK-START: void Main.testInvokeSimpleRemove() instruction_simplifier (before)
/// CHECK: CheckCast