diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/472-unreachable-if-regression/expected.txt | 3 | ||||
| -rw-r--r-- | test/472-unreachable-if-regression/info.txt | 3 | ||||
| -rw-r--r-- | test/472-unreachable-if-regression/smali/Test.smali | 46 | ||||
| -rw-r--r-- | test/472-unreachable-if-regression/src/Main.java | 37 | ||||
| -rw-r--r-- | test/Android.run-test.mk | 1 |
5 files changed, 90 insertions, 0 deletions
diff --git a/test/472-unreachable-if-regression/expected.txt b/test/472-unreachable-if-regression/expected.txt new file mode 100644 index 0000000000..9fc8bea9e2 --- /dev/null +++ b/test/472-unreachable-if-regression/expected.txt @@ -0,0 +1,3 @@ +Test started. +Successfully called UnreachableIf(). +Successfully called UnreachablePackedSwitch(). diff --git a/test/472-unreachable-if-regression/info.txt b/test/472-unreachable-if-regression/info.txt new file mode 100644 index 0000000000..d8b5a45411 --- /dev/null +++ b/test/472-unreachable-if-regression/info.txt @@ -0,0 +1,3 @@ +Regression test for crashes during compilation of methods which end +with an if-cc or switch, i.e. there's a fall-through out of method code. +Also tests a packed-switch with negative offset to its data. diff --git a/test/472-unreachable-if-regression/smali/Test.smali b/test/472-unreachable-if-regression/smali/Test.smali new file mode 100644 index 0000000000..c7107d19ee --- /dev/null +++ b/test/472-unreachable-if-regression/smali/Test.smali @@ -0,0 +1,46 @@ +# +# Copyright (C) 2015 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 LTest; + +.super Ljava/lang/Object; + +.method public static UnreachableIf()V + .registers 1 + return-void + : unreachable + not-int v0, v0 + if-lt v0, v0, :unreachable + # fall-through out of code item +.end method + +.method public static UnreachablePackedSwitch()V + .registers 1 + return-void + : unreachable + goto :pswitch_2 + :pswitch_data + .packed-switch 1 + :pswitch_1 + :pswitch_2 + :pswitch_1 + :pswitch_2 + .end packed-switch + :pswitch_1 + not-int v0, v0 + :pswitch_2 + packed-switch v0, :pswitch_data + # fall-through out of code item +.end method diff --git a/test/472-unreachable-if-regression/src/Main.java b/test/472-unreachable-if-regression/src/Main.java new file mode 100644 index 0000000000..c9f9511834 --- /dev/null +++ b/test/472-unreachable-if-regression/src/Main.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2015 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 { + + // Workaround for b/18051191. + class InnerClass {} + + public static void main(String args[]) throws Exception { + System.out.println("Test started."); + Class<?> c = Class.forName("Test"); + + Method unreachableIf = c.getMethod("UnreachableIf", (Class[]) null); + unreachableIf.invoke(null, (Object[]) null); + System.out.println("Successfully called UnreachableIf()."); + + Method unreachablePackedSwitch = c.getMethod("UnreachablePackedSwitch", (Class[]) null); + unreachablePackedSwitch.invoke(null, (Object[]) null); + System.out.println("Successfully called UnreachablePackedSwitch()."); + } + +} diff --git a/test/Android.run-test.mk b/test/Android.run-test.mk index 93340fb810..3804fb7d97 100644 --- a/test/Android.run-test.mk +++ b/test/Android.run-test.mk @@ -386,6 +386,7 @@ TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS := # Known broken tests for the optimizing compiler. TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS := TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS += 099-vmdebug # b/18098594 +TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS += 472-unreachable-if-regression # b/19988134 TEST_ART_BROKEN_OPTIMIZING_RUN_TESTS += 802-deoptimization # b/18547544 ifneq (,$(filter optimizing,$(COMPILER_TYPES))) |