summaryrefslogtreecommitdiffstats
path: root/test/434-shifter-operand
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2014-11-28 15:00:02 +0000
committerNicolas Geoffray <ngeoffray@google.com>2014-11-28 16:03:28 +0000
commit3bcc8ea079d867f26622defd0611d134a3b4ae49 (patch)
treea1f3f3ad3ec1284d199eee6e57889b8c1e90b619 /test/434-shifter-operand
parenteea79dd779ba199658ada7264f8f96d776e53f19 (diff)
downloadart-3bcc8ea079d867f26622defd0611d134a3b4ae49.zip
art-3bcc8ea079d867f26622defd0611d134a3b4ae49.tar.gz
art-3bcc8ea079d867f26622defd0611d134a3b4ae49.tar.bz2
Don't use CanHoldArm in the code generator.
CanHoldArm was ARM32 specific. Instead use a virtual Assembler::ShifterOperandCanHold that both thumb2 and arm32 implement. Change-Id: I33794a93caf02ee5d78d32a8471d9fd6fe4f0a00
Diffstat (limited to 'test/434-shifter-operand')
-rw-r--r--test/434-shifter-operand/expected.txt3
-rw-r--r--test/434-shifter-operand/info.txt2
-rw-r--r--test/434-shifter-operand/src/Main.java27
3 files changed, 32 insertions, 0 deletions
diff --git a/test/434-shifter-operand/expected.txt b/test/434-shifter-operand/expected.txt
new file mode 100644
index 0000000..52289c6
--- /dev/null
+++ b/test/434-shifter-operand/expected.txt
@@ -0,0 +1,3 @@
+false
+false
+true
diff --git a/test/434-shifter-operand/info.txt b/test/434-shifter-operand/info.txt
new file mode 100644
index 0000000..1ec9adc
--- /dev/null
+++ b/test/434-shifter-operand/info.txt
@@ -0,0 +1,2 @@
+Regression test for the arm backend of the optimizing
+compiler, that used to misuse ShifterOperand::CanHold.
diff --git a/test/434-shifter-operand/src/Main.java b/test/434-shifter-operand/src/Main.java
new file mode 100644
index 0000000..4d188eb
--- /dev/null
+++ b/test/434-shifter-operand/src/Main.java
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2014 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 {
+ public static void main(String[] args) {
+ System.out.println(foo(42));
+ System.out.println(foo(0xffffffff));
+ System.out.println(foo(0xf0000000));
+ }
+
+ public static boolean foo(int a) {
+ return a < 0xf000000b;
+ }
+}