• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Regression test for the combination of dex2oat using:
2- jar with multidex
3- vdex file where one dex file fails to fast verify (for example because of a
4  boot classpath change)
5- dex files being compiled individually
6
7We used to crash in CompilerDriver::FastVerify, assuming that only FastVerify
8can update the compiled_classes_ map. However, this isn't the case if one of the
9dex file ended up needing full verification.
10
11We need prebuilts of the .jar and .dm file as we rely on the bootclasspath to
12change which isn't expressable in a run-test. So we locally modified
13android.system.Int32Ref to inherit java.util.HashMap.
14
15The code that was used to generate the prebuilts is as follows:
16
17
18file Main.java in classes.dex:
19
20import java.util.HashMap;
21import android.system.Int32Ref;
22
23public class Main {
24  public static void main(String[] args) throws Exception {
25    try {
26      FailVerification.foo();
27      throw new Exception("Expected error");
28    } catch (Error expected) {
29    }
30  }
31}
32
33class FailVerification extends Foo {
34
35  public static void foo() {
36    Int32Ref ref = new Int32Ref(42);
37    takeHashMap(ref);
38  }
39
40  public static void takeHashMap(HashMap m) {}
41}
42
43file Foo.java in classes2.dex:
44
45public class Foo {
46}
47