Support loading vdex files without odex.
GetDexoptNeeded with 'verify' as filter will return false when a vdex is
available.
Test: 628-vdex, 820-vdex-multidex, test.py
Bug: 176960283
Change-Id: I3ac2f747d1e7f5331a49a22c94983959e3b60122
diff --git a/test/820-vdex-multidex/expected-stderr.txt b/test/820-vdex-multidex/expected-stderr.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/820-vdex-multidex/expected-stderr.txt
diff --git a/test/820-vdex-multidex/expected-stdout.txt b/test/820-vdex-multidex/expected-stdout.txt
new file mode 100644
index 0000000..e965047
--- /dev/null
+++ b/test/820-vdex-multidex/expected-stdout.txt
@@ -0,0 +1 @@
+Hello
diff --git a/test/820-vdex-multidex/info.txt b/test/820-vdex-multidex/info.txt
new file mode 100644
index 0000000..f6b87ea
--- /dev/null
+++ b/test/820-vdex-multidex/info.txt
@@ -0,0 +1 @@
+Test that vdex logic works with multidex.
diff --git a/test/820-vdex-multidex/run b/test/820-vdex-multidex/run
new file mode 100644
index 0000000..3f6dc3c
--- /dev/null
+++ b/test/820-vdex-multidex/run
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+# Copyright (C) 2021 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.
+
+exec ${RUN} -Xcompiler-option --compiler-filter=verify --vdex "${@}"
diff --git a/test/820-vdex-multidex/src-multidex/Foo.java b/test/820-vdex-multidex/src-multidex/Foo.java
new file mode 100644
index 0000000..6d18efb
--- /dev/null
+++ b/test/820-vdex-multidex/src-multidex/Foo.java
@@ -0,0 +1,18 @@
+/*
+ * Copyright (C) 2021 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 Foo {
+}
diff --git a/test/820-vdex-multidex/src/Main.java b/test/820-vdex-multidex/src/Main.java
new file mode 100644
index 0000000..164e784
--- /dev/null
+++ b/test/820-vdex-multidex/src/Main.java
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2021 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("Hello");
+ }
+}
+