diff options
Diffstat (limited to 'test')
38 files changed, 396 insertions, 70 deletions
diff --git a/test/004-StackWalk/src/Main.java b/test/004-StackWalk/src/Main.java index 883ce2c9fe..072b1d0c4d 100644 --- a/test/004-StackWalk/src/Main.java +++ b/test/004-StackWalk/src/Main.java @@ -2,14 +2,14 @@ public class Main { public Main() { } + boolean doThrow = false; + int $noinline$f() throws Exception { g(1); g(2); - // This loop currently defeats inlining of `f`. - for (int i = 0; i < 10; i++) { - Thread.sleep(0); - } + // This currently defeats inlining of `f`. + if (doThrow) { throw new Error(); } return 0; } diff --git a/test/048-reflect-v8/build b/test/048-reflect-v8/build new file mode 100644 index 0000000000..4ea1838465 --- /dev/null +++ b/test/048-reflect-v8/build @@ -0,0 +1,28 @@ +#!/bin/bash +# +# Copyright 2016 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. + +# Make us exit on a failure. +set -e + +# Hard-wired use of experimental jack. +# TODO: fix this temporary work-around for lambdas, see b/19467889 +export USE_JACK=true +export JACK_SERVER=false +export JACK_REPOSITORY="${ANDROID_BUILD_TOP}/prebuilts/sdk/tools/jacks" +# e.g. /foo/bar/jack-3.10.ALPHA.jar -> 3.10.ALPHA +export JACK_VERSION="$(find "$JACK_REPOSITORY" -name '*ALPHA*' | sed 's/.*jack-//g' | sed 's/[.]jar//g')" + +./default-build "$@" --experimental default-methods diff --git a/test/048-reflect-v8/expected.txt b/test/048-reflect-v8/expected.txt new file mode 100644 index 0000000000..2d0b4ccb6b --- /dev/null +++ b/test/048-reflect-v8/expected.txt @@ -0,0 +1,4 @@ +Main$DefaultInterface is default = yes +Main$RegularInterface is default = no +Main$ImplementsWithDefault is default = yes +Main$ImplementsWithRegular is default = no diff --git a/test/048-reflect-v8/info.txt b/test/048-reflect-v8/info.txt new file mode 100644 index 0000000000..a336d301d6 --- /dev/null +++ b/test/048-reflect-v8/info.txt @@ -0,0 +1 @@ +Test reflection for 1.8 APIs diff --git a/test/048-reflect-v8/run b/test/048-reflect-v8/run new file mode 100644 index 0000000000..0ad55fd6e9 --- /dev/null +++ b/test/048-reflect-v8/run @@ -0,0 +1,19 @@ +#!/bin/bash +# +# Copyright (C) 2016 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. + + +# Ensure that the default methods are turned on for dalvikvm and dex2oat +${RUN} "$@" --experimental default-methods -Xcompiler-option diff --git a/test/048-reflect-v8/src/Main.java b/test/048-reflect-v8/src/Main.java new file mode 100644 index 0000000000..7fa2a923d7 --- /dev/null +++ b/test/048-reflect-v8/src/Main.java @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2016 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. + */ + +import java.lang.reflect.Method; + +public class Main { + interface DefaultInterface { + default void sayHi() { + System.out.println("hi default"); + } + } + + interface RegularInterface { + void sayHi(); + } + + class ImplementsWithDefault implements DefaultInterface {} + class ImplementsWithRegular implements RegularInterface { + public void sayHi() { + System.out.println("hello specific"); + } + } + + private static void printIsDefault(Class<?> klass) { + Method m; + try { + m = klass.getMethod("sayHi"); + } catch (Throwable t) { + System.out.println(t); + return; + } + + boolean isDefault = m.isDefault(); + System.out.println(klass.getName() + " is default = " + (isDefault ? "yes" : "no")); + } + + public static void main(String[] args) { + printIsDefault(DefaultInterface.class); + printIsDefault(RegularInterface.class); + printIsDefault(ImplementsWithDefault.class); + printIsDefault(ImplementsWithRegular.class); + } +} diff --git a/test/127-secondarydex/build b/test/127-checker-secondarydex/build index 0d9f4d6291..0d9f4d6291 100755 --- a/test/127-secondarydex/build +++ b/test/127-checker-secondarydex/build diff --git a/test/127-secondarydex/expected.txt b/test/127-checker-secondarydex/expected.txt index 1c8defb6ec..1c8defb6ec 100644 --- a/test/127-secondarydex/expected.txt +++ b/test/127-checker-secondarydex/expected.txt diff --git a/test/127-secondarydex/info.txt b/test/127-checker-secondarydex/info.txt index 0479d1a784..0479d1a784 100644 --- a/test/127-secondarydex/info.txt +++ b/test/127-checker-secondarydex/info.txt diff --git a/test/127-secondarydex/run b/test/127-checker-secondarydex/run index d8c3c798bf..d8c3c798bf 100755 --- a/test/127-secondarydex/run +++ b/test/127-checker-secondarydex/run diff --git a/test/127-secondarydex/src/Main.java b/test/127-checker-secondarydex/src/Main.java index 0ede8ed2b2..0ede8ed2b2 100644 --- a/test/127-secondarydex/src/Main.java +++ b/test/127-checker-secondarydex/src/Main.java diff --git a/test/127-secondarydex/src/Super.java b/test/127-checker-secondarydex/src/Super.java index 7608d4a7c8..7608d4a7c8 100644 --- a/test/127-secondarydex/src/Super.java +++ b/test/127-checker-secondarydex/src/Super.java diff --git a/test/127-secondarydex/src/Test.java b/test/127-checker-secondarydex/src/Test.java index 8547e791c2..266ed191bc 100644 --- a/test/127-secondarydex/src/Test.java +++ b/test/127-checker-secondarydex/src/Test.java @@ -23,6 +23,13 @@ public class Test extends Super { System.out.println("Test"); } + /// CHECK-START: java.lang.Integer Test.toInteger() ssa_builder (after) + /// CHECK: LoadClass needs_access_check:false klass:java.lang.Integer + + public Integer toInteger() { + return new Integer(42); + } + public String toString() { return new String("Test"); } diff --git a/test/137-cfi/cfi.cc b/test/137-cfi/cfi.cc index 9bfe42922b..77301d20e8 100644 --- a/test/137-cfi/cfi.cc +++ b/test/137-cfi/cfi.cc @@ -76,7 +76,7 @@ static bool CheckStack(Backtrace* bt, const std::vector<std::string>& seq) { } } - printf("Can not find %s in backtrace:\n", seq[cur_search_index].c_str()); + printf("Cannot find %s in backtrace:\n", seq[cur_search_index].c_str()); for (Backtrace::const_iterator it = bt->begin(); it != bt->end(); ++it) { if (BacktraceMap::IsValid(it->map)) { printf(" %s\n", it->func_name.c_str()); @@ -112,7 +112,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_Main_unwindInProcess(JNIEnv*, jobject std::unique_ptr<Backtrace> bt(Backtrace::Create(BACKTRACE_CURRENT_PROCESS, GetTid())); if (!bt->Unwind(0, nullptr)) { - printf("Can not unwind in process.\n"); + printf("Cannot unwind in process.\n"); return JNI_FALSE; } else if (bt->NumFrames() == 0) { printf("No frames for unwind in process.\n"); @@ -205,7 +205,7 @@ extern "C" JNIEXPORT jboolean JNICALL Java_Main_unwindOtherProcess(JNIEnv*, jobj std::unique_ptr<Backtrace> bt(Backtrace::Create(pid, BACKTRACE_CURRENT_THREAD)); bool result = true; if (!bt->Unwind(0, nullptr)) { - printf("Can not unwind other process.\n"); + printf("Cannot unwind other process.\n"); result = false; } else if (bt->NumFrames() == 0) { printf("No frames for unwind of other process.\n"); diff --git a/test/141-class-unload/src/Main.java b/test/141-class-unload/src/Main.java index 0640b364c9..bcb697a396 100644 --- a/test/141-class-unload/src/Main.java +++ b/test/141-class-unload/src/Main.java @@ -79,7 +79,7 @@ public class Main { private static void testUnloadClass(Constructor constructor) throws Exception { WeakReference<Class> klass = setUpUnloadClass(constructor); - // No strong refernces to class loader, should get unloaded. + // No strong references to class loader, should get unloaded. Runtime.getRuntime().gc(); WeakReference<Class> klass2 = setUpUnloadClass(constructor); Runtime.getRuntime().gc(); @@ -91,7 +91,7 @@ public class Main { private static void testUnloadLoader(Constructor constructor) throws Exception { WeakReference<ClassLoader> loader = setUpUnloadLoader(constructor, true); - // No strong refernces to class loader, should get unloaded. + // No strong references to class loader, should get unloaded. Runtime.getRuntime().gc(); // If the weak reference is cleared, then it was unloaded. System.out.println(loader.get()); @@ -109,7 +109,7 @@ public class Main { private static void testLoadAndUnloadLibrary(Constructor constructor) throws Exception { WeakReference<ClassLoader> loader = setUpLoadLibrary(constructor); - // No strong refernces to class loader, should get unloaded. + // No strong references to class loader, should get unloaded. Runtime.getRuntime().gc(); // If the weak reference is cleared, then it was unloaded. System.out.println(loader.get()); diff --git a/test/143-string-value/check b/test/143-string-value/check index cdf7b783a3..92f6e90023 100755 --- a/test/143-string-value/check +++ b/test/143-string-value/check @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Strip run-specific numbers (pid and line number) -sed -e 's/^art E[ ]\+[0-9]\+[ ]\+[0-9]\+ art\/runtime\/native\/java_lang_Class.cc:[0-9]\+\] //' "$2" > "$2.tmp" +# Strip error log messages. +sed -e '/^art E.*\] /d' "$2" > "$2.tmp" diff --strip-trailing-cr -q "$1" "$2.tmp" >/dev/null diff --git a/test/482-checker-loop-back-edge-use/src/Main.java b/test/482-checker-loop-back-edge-use/src/Main.java index d0b33b9282..f8f0aa3f0a 100644 --- a/test/482-checker-loop-back-edge-use/src/Main.java +++ b/test/482-checker-loop-back-edge-use/src/Main.java @@ -40,6 +40,9 @@ public class Main { /// CHECK-EVAL: <<GotoLiv2>> + 2 == <<ArgLoopUse2>> public static void loop2(boolean incoming) { + // Add some code at entry to avoid having the entry block be a pre header. + // This avoids having to create a synthesized block. + System.out.println("Enter"); while (true) { System.out.println("foo"); while (incoming) {} @@ -170,6 +173,9 @@ public class Main { /// CHECK-EVAL: <<GotoLiv1>> + 2 == <<ArgLoopUse>> public static void loop9() { + // Add some code at entry to avoid having the entry block be a pre header. + // This avoids having to create a synthesized block. + System.out.println("Enter"); while (Runtime.getRuntime() != null) { // 'incoming' must only have a use in the inner loop. boolean incoming = field; diff --git a/test/510-checker-try-catch/smali/SsaBuilder.smali b/test/510-checker-try-catch/smali/SsaBuilder.smali index 710e849c45..a6a5bfebee 100644 --- a/test/510-checker-try-catch/smali/SsaBuilder.smali +++ b/test/510-checker-try-catch/smali/SsaBuilder.smali @@ -21,7 +21,7 @@ ## CHECK-START: int SsaBuilder.testSimplifyCatchBlock(int, int, int) ssa_builder (after) -## CHECK: name "B0" +## CHECK: name "B1" ## CHECK-NEXT: from_bci ## CHECK-NEXT: to_bci ## CHECK-NEXT: predecessors @@ -39,12 +39,15 @@ ## CHECK: name "<<BExtracted>>" ## CHECK-NEXT: from_bci ## CHECK-NEXT: to_bci -## CHECK-NEXT: predecessors "B0" "<<BCatch>>" +## CHECK-NEXT: predecessors "B1" "<<BCatch>>" ## CHECK-NOT: flags "catch_block" ## CHECK: Add .method public static testSimplifyCatchBlock(III)I .registers 4 + # Avoid entry block be a pre header, which leads to + # the cfg simplifier to add a synthesized block. + goto :catch_all :catch_all add-int/2addr p0, p1 diff --git a/test/559-checker-irreducible-loop/smali/IrreducibleLoop.smali b/test/559-checker-irreducible-loop/smali/IrreducibleLoop.smali index 30a648d764..971ad84241 100644 --- a/test/559-checker-irreducible-loop/smali/IrreducibleLoop.smali +++ b/test/559-checker-irreducible-loop/smali/IrreducibleLoop.smali @@ -91,9 +91,7 @@ goto :other_loop_entry .end method -# Check that if a irreducible loop entry is dead, the loop can become -# natural. -# We start with: +# Check that dce does not apply for irreducible loops. # # entry # / \ @@ -106,18 +104,8 @@ ## CHECK-START: int IrreducibleLoop.dce(int) dead_code_elimination (before) ## CHECK: irreducible:true -# And end with: -# -# entry -# / -# / -# loop_entry -# / \- -# exit \- -# other_loop_entry - ## CHECK-START: int IrreducibleLoop.dce(int) dead_code_elimination (after) -## CHECK-NOT: irreducible:true +## CHECK: irreducible:true .method public static dce(I)I .registers 3 const/16 v0, 42 diff --git a/test/563-checker-fakestring/smali/TestCase.smali b/test/563-checker-fakestring/smali/TestCase.smali index 814cda5345..54312a43d0 100644 --- a/test/563-checker-fakestring/smali/TestCase.smali +++ b/test/563-checker-fakestring/smali/TestCase.smali @@ -64,9 +64,15 @@ .end method -# Test deoptimization between String's allocation and initialization. +# Test deoptimization between String's allocation and initialization. When not +# compiling --debuggable, the NewInstance will be optimized out. ## CHECK-START: int TestCase.deoptimizeNewInstance(int[], byte[]) register (after) +## CHECK: <<Null:l\d+>> NullConstant +## CHECK: Deoptimize env:[[<<Null>>,{{.*]]}} +## CHECK: InvokeStaticOrDirect method_name:java.lang.String.<init> + +## CHECK-START-DEBUGGABLE: int TestCase.deoptimizeNewInstance(int[], byte[]) register (after) ## CHECK: <<String:l\d+>> NewInstance ## CHECK: Deoptimize env:[[<<String>>,{{.*]]}} ## CHECK: InvokeStaticOrDirect method_name:java.lang.String.<init> @@ -99,39 +105,78 @@ .end method -# Test throwing and catching an exception between String's allocation and initialization. +# Test that a redundant NewInstance is removed if not used and not compiling +# --debuggable. -## CHECK-START: void TestCase.catchNewInstance() register (after) -## CHECK-DAG: <<Null:l\d+>> NullConstant -## CHECK-DAG: <<Zero:i\d+>> IntConstant 0 -## CHECK-DAG: <<String:l\d+>> NewInstance -## CHECK-DAG: <<UTF8:l\d+>> LoadString -## CHECK-DAG: InvokeStaticOrDirect [<<Null>>,<<UTF8>>] env:[[<<String>>,<<Zero>>,<<UTF8>>]] -## CHECK-DAG: Phi [<<Null>>,<<Null>>,<<String>>] reg:0 is_catch_phi:true +## CHECK-START: java.lang.String TestCase.removeNewInstance(byte[]) register (after) +## CHECK-NOT: NewInstance +## CHECK-NOT: LoadClass -.method public static catchNewInstance()V - .registers 3 +## CHECK-START-DEBUGGABLE: java.lang.String TestCase.removeNewInstance(byte[]) register (after) +## CHECK: NewInstance + +.method public static removeNewInstance([B)Ljava/lang/String; + .registers 5 - const v0, 0x0 - :try_start new-instance v0, Ljava/lang/String; + const-string v1, "UTF8" + invoke-direct {v0, p0, v1}, Ljava/lang/String;-><init>([BLjava/lang/String;)V + return-object v0 - # Calling String.<init> on null byte array will throw NullPointerException - # with v0 = new-instance. - const v1, 0x0 - const-string v2, "UTF8" - invoke-direct {v0, v1, v2}, Ljava/lang/String;-><init>([BLjava/lang/String;)V - :try_end - .catchall {:try_start .. :try_end} :catch - return-void +.end method - # Catch exception and test v0. Do not throw if it is not null. - :catch - move-exception v1 - if-nez v0, :return - throw v1 +# Test that the compiler does not assume that the first argument of String.<init> +# is a NewInstance by inserting an irreducible loop between them (b/26676472). - :return - return-void +# We verify the type of the input instruction (Phi) in debuggable mode, because +# it is eliminated by later stages of SsaBuilder otherwise. + +## CHECK-START-DEBUGGABLE: java.lang.String TestCase.thisNotNewInstance1(byte[], boolean) register (after) +## CHECK-DAG: InvokeStaticOrDirect env:[[<<Phi:l\d+>>,{{.*]]}} +## CHECK-DAG: <<Phi>> Phi + +.method public static thisNotNewInstance1([BZ)Ljava/lang/String; + .registers 5 + + new-instance v0, Ljava/lang/String; + + # Irreducible loop + if-eqz p1, :loop_entry + :loop_header + const v1, 0x1 + xor-int p1, p1, v1 + :loop_entry + if-eqz p1, :string_init + goto :loop_header + + :string_init + const-string v1, "UTF8" + invoke-direct {v0, p0, v1}, Ljava/lang/String;-><init>([BLjava/lang/String;)V + return-object v0 + +.end method + +## CHECK-START-DEBUGGABLE: java.lang.String TestCase.thisNotNewInstance2(byte[], boolean) register (after) +## CHECK-DAG: InvokeStaticOrDirect env:[[<<Phi:l\d+>>,{{.*]]}} +## CHECK-DAG: <<Phi>> Phi + +.method public static thisNotNewInstance2([BZ)Ljava/lang/String; + .registers 5 + + new-instance v0, Ljava/lang/String; + + # Irreducible loop + if-eqz p1, :loop_entry + :loop_header + if-eqz p1, :string_init + :loop_entry + const v1, 0x1 + xor-int p1, p1, v1 + goto :loop_header + + :string_init + const-string v1, "UTF8" + invoke-direct {v0, p0, v1}, Ljava/lang/String;-><init>([BLjava/lang/String;)V + return-object v0 .end method diff --git a/test/563-checker-fakestring/src/Main.java b/test/563-checker-fakestring/src/Main.java index e0bfa7d5b1..1ac8a5bfcf 100644 --- a/test/563-checker-fakestring/src/Main.java +++ b/test/563-checker-fakestring/src/Main.java @@ -59,7 +59,24 @@ public class Main { } { - c.getMethod("catchNewInstance").invoke(null, (Object[]) null); + Method m = c.getMethod("removeNewInstance", byte[].class); + String result = (String) m.invoke(null, new Object[] { testData }); + assertEqual(testString, result); + } + + { + Method m = c.getMethod("thisNotNewInstance1", byte[].class, boolean.class); + String result = (String) m.invoke(null, new Object[] { testData, true }); + assertEqual(testString, result); + result = (String) m.invoke(null, new Object[] { testData, false }); + assertEqual(testString, result); + } + { + Method m = c.getMethod("thisNotNewInstance2", byte[].class, boolean.class); + String result = (String) m.invoke(null, new Object[] { testData, true }); + assertEqual(testString, result); + result = (String) m.invoke(null, new Object[] { testData, false }); + assertEqual(testString, result); } } } diff --git a/test/564-checker-inline-loop/expected.txt b/test/564-checker-inline-loop/expected.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/564-checker-inline-loop/expected.txt diff --git a/test/564-checker-inline-loop/info.txt b/test/564-checker-inline-loop/info.txt new file mode 100644 index 0000000000..a590bc6f23 --- /dev/null +++ b/test/564-checker-inline-loop/info.txt @@ -0,0 +1 @@ +Tests inlining of loops in the optimizing compiler. diff --git a/test/564-checker-inline-loop/src/Main.java b/test/564-checker-inline-loop/src/Main.java new file mode 100644 index 0000000000..6929913864 --- /dev/null +++ b/test/564-checker-inline-loop/src/Main.java @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2016 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. + */ + +public class Main { + + /// CHECK-START: int Main.inlineLoop() inliner (before) + /// CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect + /// CHECK-DAG: Return [<<Invoke>>] + + /// CHECK-START: int Main.inlineLoop() inliner (after) + /// CHECK-NOT: InvokeStaticOrDirect + + /// CHECK-START: int Main.inlineLoop() inliner (after) + /// CHECK-DAG: <<Constant:i\d+>> IntConstant 42 + /// CHECK-DAG: Return [<<Constant>>] + + /// CHECK-START: int Main.inlineLoop() licm (after) + /// CHECK: Goto loop:{{B\d+}} + + public static int inlineLoop() { + return loopMethod(); + } + + /// CHECK-START: void Main.inlineWithinLoop() inliner (before) + /// CHECK: InvokeStaticOrDirect + + /// CHECK-START: void Main.inlineWithinLoop() inliner (after) + /// CHECK-NOT: InvokeStaticOrDirect + + /// CHECK-START: void Main.inlineWithinLoop() licm (after) + /// CHECK-DAG: Goto loop:<<OuterLoop:B\d+>> outer_loop:none + /// CHECK-DAG: Goto outer_loop:<<OuterLoop>> + + public static void inlineWithinLoop() { + while (doLoop) { + loopMethod(); + } + } + + public static int loopMethod() { + while (doLoop) {} + return 42; + } + + public static boolean doLoop = false; + + public static void main(String[] args) { + inlineLoop(); + inlineWithinLoop(); + } +} diff --git a/test/800-smali/expected.txt b/test/800-smali/expected.txt index 27f5b5d552..2e66af59e7 100644 --- a/test/800-smali/expected.txt +++ b/test/800-smali/expected.txt @@ -49,4 +49,5 @@ b/23502994 (check-cast) b/25494456 b/21869691 b/26143249 +b/26579108 Done! diff --git a/test/800-smali/smali/b_26579108.smali b/test/800-smali/smali/b_26579108.smali new file mode 100644 index 0000000000..dde38256a1 --- /dev/null +++ b/test/800-smali/smali/b_26579108.smali @@ -0,0 +1,34 @@ +# Copyright (C) 2016 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 public LB26579108; +.super Ljava/lang/Object; + +# Ensure that merging uninitialized type and null does not pass verification. + +.field public static field:I + +.method public static run()Ljava/lang/String; + .registers 2 + new-instance v0, Ljava/lang/String; + + sget v1, LB26579108;->field:I + if-eqz v1, :cond_5 + + const/4 v0, 0x0 + :cond_5 + + invoke-direct {v0}, Ljava/lang/String;-><init>()V + return-object v0 + .end method diff --git a/test/800-smali/src/Main.java b/test/800-smali/src/Main.java index cc3b0b44f9..38aa58de77 100644 --- a/test/800-smali/src/Main.java +++ b/test/800-smali/src/Main.java @@ -143,6 +143,8 @@ public class Main { new IncompatibleClassChangeError(), null)); testCases.add(new TestCase("b/26143249", "B26143249", "run", null, new AbstractMethodError(), null)); + testCases.add(new TestCase("b/26579108", "B26579108", "run", null, new VerifyError(), + null)); } public void runTests() { @@ -188,8 +190,7 @@ public class Main { if (tc.expectedException != null) { errorReturn = new IllegalStateException("Expected an exception in test " + tc.testName); - } - if (tc.expectedReturn == null && retValue != null) { + } else if (tc.expectedReturn == null && retValue != null) { errorReturn = new IllegalStateException("Expected a null result in test " + tc.testName); } else if (tc.expectedReturn != null && diff --git a/test/971-iface-super-partial-compile-generated/build b/test/971-iface-super/build index 1e9f8aadd5..1e9f8aadd5 100755 --- a/test/971-iface-super-partial-compile-generated/build +++ b/test/971-iface-super/build diff --git a/test/971-iface-super-partial-compile-generated/expected.txt b/test/971-iface-super/expected.txt index 1ddd65d177..1ddd65d177 100644 --- a/test/971-iface-super-partial-compile-generated/expected.txt +++ b/test/971-iface-super/expected.txt diff --git a/test/971-iface-super-partial-compile-generated/info.txt b/test/971-iface-super/info.txt index bc1c42816e..bc1c42816e 100644 --- a/test/971-iface-super-partial-compile-generated/info.txt +++ b/test/971-iface-super/info.txt diff --git a/test/971-iface-super-partial-compile-generated/run b/test/971-iface-super/run index 6d2930d463..6d2930d463 100755 --- a/test/971-iface-super-partial-compile-generated/run +++ b/test/971-iface-super/run diff --git a/test/971-iface-super-partial-compile-generated/util-src/generate_java.py b/test/971-iface-super/util-src/generate_java.py index 99b0479c8f..99b0479c8f 100755 --- a/test/971-iface-super-partial-compile-generated/util-src/generate_java.py +++ b/test/971-iface-super/util-src/generate_java.py diff --git a/test/971-iface-super-partial-compile-generated/util-src/generate_smali.py b/test/971-iface-super/util-src/generate_smali.py index f01c9043b9..f01c9043b9 100755 --- a/test/971-iface-super-partial-compile-generated/util-src/generate_smali.py +++ b/test/971-iface-super/util-src/generate_smali.py diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk index 7ec30677e1..586c80528e 100644 --- a/test/Android.run-test.mk +++ b/test/Android.run-test.mk @@ -242,7 +242,7 @@ TEST_ART_PYTHON3_DEPENDENCY_RUN_TESTS := \ 968-default-partial-compile-generated \ 969-iface-super \ 970-iface-super-resolution-generated \ - 971-iface-super-partial-compile-generated + 971-iface-super # Check if we have python3 to run our tests. ifeq ($(wildcard /usr/bin/python3),) @@ -270,16 +270,6 @@ endif TEST_ART_BROKEN_PREBUILD_RUN_TESTS := -# 143-string-value tests for a LOG(E) tag, which is only supported on host. -TEST_ART_BROKEN_TARGET_RUN_TESTS := \ - 143-string-value \ - -ART_TEST_KNOWN_BROKEN += $(call all-run-test-names,target,$(RUN_TYPES),$(PREBUILD_TYPES), \ - $(COMPILER_TYPES),$(RELOCATE_TYPES),$(TRACE_TYPES),$(GC_TYPES),$(JNI_TYPES), \ - $(IMAGE_TYPES), $(PICTEST_TYPES), $(DEBUGGABLE_TYPES), $(TEST_ART_BROKEN_TARGET_RUN_TESTS), $(ALL_ADDRESS_SIZES)) - -TEST_ART_BROKEN_TARGET_RUN_TESTS := - # 554-jit-profile-file is disabled because it needs a primary oat file to know what it should save. TEST_ART_BROKEN_NO_PREBUILD_TESTS := \ 117-nopatchoat \ @@ -546,10 +536,13 @@ TEST_ART_BROKEN_DEFAULT_READ_BARRIER_RUN_TESTS := \ # Tests that should fail in the read barrier configuration with the Optimizing compiler. # 484: Baker's fast path based read barrier compiler instrumentation generates code containing # more parallel moves on x86, thus some Checker assertions may fail. +# 527: On ARM64, the read barrier instrumentation does not support the HArm64IntermediateAddress +# instruction yet (b/26601270). # 537: Expects an array copy to be intrinsified on x86-64, but calling-on-slowpath intrinsics are # not yet handled in the read barrier configuration. TEST_ART_BROKEN_OPTIMIZING_READ_BARRIER_RUN_TESTS := \ 484-checker-register-hints \ + 527-checker-array-access-split \ 537-checker-arraycopy # Tests that should fail in the read barrier configuration with JIT. diff --git a/test/ProfileTestMultiDex/Main.java b/test/ProfileTestMultiDex/Main.java new file mode 100644 index 0000000000..41532ea8f7 --- /dev/null +++ b/test/ProfileTestMultiDex/Main.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2016 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 Main { + public String getA() { + return "A"; + } + public String getB() { + return "B"; + } + public String getC() { + return "C"; + } +} diff --git a/test/ProfileTestMultiDex/Second.java b/test/ProfileTestMultiDex/Second.java new file mode 100644 index 0000000000..4ac5abc300 --- /dev/null +++ b/test/ProfileTestMultiDex/Second.java @@ -0,0 +1,27 @@ +/* + * Copyright (C) 2016 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 Second { + public String getX() { + return "X"; + } + public String getY() { + return "Y"; + } + public String getZ() { + return "Z"; + } +} diff --git a/test/ProfileTestMultiDex/main.jpp b/test/ProfileTestMultiDex/main.jpp new file mode 100644 index 0000000000..f2e3b4e14c --- /dev/null +++ b/test/ProfileTestMultiDex/main.jpp @@ -0,0 +1,3 @@ +main: + @@com.android.jack.annotations.ForceInMainDex + class Second diff --git a/test/ProfileTestMultiDex/main.list b/test/ProfileTestMultiDex/main.list new file mode 100644 index 0000000000..44ba78ead5 --- /dev/null +++ b/test/ProfileTestMultiDex/main.list @@ -0,0 +1 @@ +Main.class |