summaryrefslogtreecommitdiff
path: root/dx/tests/079-dex-local-variable-renumbering
diff options
context:
space:
mode:
Diffstat (limited to 'dx/tests/079-dex-local-variable-renumbering')
-rw-r--r--dx/tests/079-dex-local-variable-renumbering/Blort.java39
-rw-r--r--dx/tests/079-dex-local-variable-renumbering/expected.txt87
-rw-r--r--dx/tests/079-dex-local-variable-renumbering/info.txt7
-rw-r--r--dx/tests/079-dex-local-variable-renumbering/run19
4 files changed, 152 insertions, 0 deletions
diff --git a/dx/tests/079-dex-local-variable-renumbering/Blort.java b/dx/tests/079-dex-local-variable-renumbering/Blort.java
new file mode 100644
index 0000000..c8453a2
--- /dev/null
+++ b/dx/tests/079-dex-local-variable-renumbering/Blort.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2007 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 Blort
+{
+ public static int test1(int x) {
+ float f0 = 0.0f;
+ float f1 = 0.0f;
+ float f2 = 0.0f;
+ float f3 = 0.0f;
+ float f4 = 0.0f;
+ float f5 = 0.0f;
+ float f6 = 0.0f;
+ float f7 = 0.0f;
+ float f8 = 0.0f;
+ float f9 = 0.0f;
+ float f10 = 0.0f;
+ float f11 = 0.0f;
+ float f12 = 0.0f;
+ float f13 = 0.0f;
+ float f14 = 0.0f;
+ float f15 = 0.0f;
+ int x16 = x;
+ return -x16;
+ }
+}
diff --git a/dx/tests/079-dex-local-variable-renumbering/expected.txt b/dx/tests/079-dex-local-variable-renumbering/expected.txt
new file mode 100644
index 0000000..94ba113
--- /dev/null
+++ b/dx/tests/079-dex-local-variable-renumbering/expected.txt
@@ -0,0 +1,87 @@
+Blort.test1:(I)I:
+regs: 0015; ins: 0001; outs: 0000
+ 0000: move/from16 v1, v20
+ 0002: const/16 v19, #float 0.0 // #0000
+ 0004: move/from16 v2, v19
+ 0006: const/16 v19, #float 0.0 // #0000
+ 0008: move/from16 v3, v19
+ 000a: const/16 v19, #float 0.0 // #0000
+ 000c: move/from16 v4, v19
+ 000e: const/16 v19, #float 0.0 // #0000
+ 0010: move/from16 v5, v19
+ 0012: const/16 v19, #float 0.0 // #0000
+ 0014: move/from16 v6, v19
+ 0016: const/16 v19, #float 0.0 // #0000
+ 0018: move/from16 v7, v19
+ 001a: const/16 v19, #float 0.0 // #0000
+ 001c: move/from16 v8, v19
+ 001e: const/16 v19, #float 0.0 // #0000
+ 0020: move/from16 v9, v19
+ 0022: const/16 v19, #float 0.0 // #0000
+ 0024: move/from16 v10, v19
+ 0026: const/16 v19, #float 0.0 // #0000
+ 0028: move/from16 v11, v19
+ 002a: const/16 v19, #float 0.0 // #0000
+ 002c: move/from16 v12, v19
+ 002e: const/16 v19, #float 0.0 // #0000
+ 0030: move/from16 v13, v19
+ 0032: const/16 v19, #float 0.0 // #0000
+ 0034: move/from16 v14, v19
+ 0036: const/16 v19, #float 0.0 // #0000
+ 0038: move/from16 v15, v19
+ 003a: const/16 v19, #float 0.0 // #0000
+ 003c: move/from16 v16, v19
+ 003e: const/16 v19, #float 0.0 // #0000
+ 0040: move/from16 v17, v19
+ 0042: move/from16 v19, v1
+ 0044: move/from16 v18, v19
+ 0046: move/from16 v19, v18
+ 0048: move/from16 v0, v19
+ 004a: neg-int v0, v0
+ 004b: move/from16 v19, v0
+ 004d: move/from16 v1, v19
+ 004f: return v1
+ debug info
+ line_start: 1
+ parameters_size: 0001
+ parameter <unnamed> v20
+ 0000: prologue end
+ 0002: advance pc
+ 0002: +local v1 x int
+ 0006: advance pc
+ 0006: +local v2 f0 float
+ 000a: advance pc
+ 000a: +local v3 f1 float
+ 000e: advance pc
+ 000e: +local v4 f2 float
+ 0012: advance pc
+ 0012: +local v5 f3 float
+ 0016: advance pc
+ 0016: +local v6 f4 float
+ 001a: advance pc
+ 001a: +local v7 f5 float
+ 001e: advance pc
+ 001e: +local v8 f6 float
+ 0022: advance pc
+ 0022: +local v9 f7 float
+ 0026: advance pc
+ 0026: +local v10 f8 float
+ 002a: advance pc
+ 002a: +local v11 f9 float
+ 002e: advance pc
+ 002e: +local v12 f10 float
+ 0032: advance pc
+ 0032: +local v13 f11 float
+ 0036: advance pc
+ 0036: +local v14 f12 float
+ 003a: advance pc
+ 003a: +local v15 f13 float
+ 003e: advance pc
+ 003e: +local v16 f14 float
+ 0042: advance pc
+ 0042: +local v17 f15 float
+ 0046: advance pc
+ 0046: +local v18 x16 int
+ 004f: advance pc
+ 004f: -local v1 x int
+ end sequence
diff --git a/dx/tests/079-dex-local-variable-renumbering/info.txt b/dx/tests/079-dex-local-variable-renumbering/info.txt
new file mode 100644
index 0000000..249b23f
--- /dev/null
+++ b/dx/tests/079-dex-local-variable-renumbering/info.txt
@@ -0,0 +1,7 @@
+This is a smoke test of dex conversion, which checks to make sure that
+local variable tables stay in sync when the register set gets renumbered
+to make room for low scratch registers.
+
+This test compares emitted code against a known-good (via eyeballing)
+version, so it is possible for this test to spuriously fail if other
+aspects of conversion end up altering the output in innocuous ways.
diff --git a/dx/tests/079-dex-local-variable-renumbering/run b/dx/tests/079-dex-local-variable-renumbering/run
new file mode 100644
index 0000000..426f1e6
--- /dev/null
+++ b/dx/tests/079-dex-local-variable-renumbering/run
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Copyright (C) 2007 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.
+
+$JAVAC -g -d . Blort.java
+dx --debug --dex --no-optimize --positions=none --dump-method=Blort.test'*' \
+ *.class