Merge "Update art test status for dalvik 4.4.4."
diff --git a/src/test/java/com/android/tools/r8/R8RunArtTestsTest.java b/src/test/java/com/android/tools/r8/R8RunArtTestsTest.java
index 7cb47e2..bfa9b82 100644
--- a/src/test/java/com/android/tools/r8/R8RunArtTestsTest.java
+++ b/src/test/java/com/android/tools/r8/R8RunArtTestsTest.java
@@ -20,7 +20,6 @@
 import com.android.tools.r8.utils.FileUtils;
 import com.android.tools.r8.utils.JarBuilder;
 import com.android.tools.r8.utils.ListUtils;
-import com.android.tools.r8.utils.OffOrAuto;
 import com.google.common.base.Charsets;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableListMultimap;
@@ -152,6 +151,8 @@
           // Takes ages to run on art 5.1.1 and behaves the same as on 6.0.1. Running this
           // tests on 5.1.1 makes our buildbot cycles time too long.
           .put("800-smali", TestCondition.match(TestCondition.runtimes(DexVm.ART_5_1_1)))
+          // Hangs on dalvik.
+          .put("802-deoptimization", TestCondition.match(TestCondition.runtimes(DexVm.ART_4_4_4)))
           .build();
 
   // Tests that are flaky with the Art version we currently use.
@@ -452,8 +453,24 @@
           "605-new-string-from-bytes",
           "626-const-class-linking"
       ),
-      DexVm.ART_4_4_4, ImmutableList.of()
-
+      DexVm.ART_4_4_4, ImmutableList.of(
+          // Generally fails on non R8/D8 running.
+          "004-checker-UnsafeTest18",
+          "004-NativeAllocations",
+          "005-annotations",
+          "008-exceptions",
+          "082-inline-execute",
+          "099-vmdebug",
+          "143-string-value",
+          "530-checker-lse2",
+          "536-checker-intrinsic-optimization",
+          "552-invoke-non-existent-super",
+          "580-checker-round",
+          "580-checker-string-fact-intrinsics",
+          "594-invoke-super",
+          "605-new-string-from-bytes",
+          "626-const-class-linking"
+      )
   );
 
   // Tests where the R8/D8 output runs in Art but the original does not.
@@ -464,7 +481,15 @@
   private static final Multimap<String, TestCondition> failingRunWithArt =
       new ImmutableListMultimap.Builder<String, TestCondition>()
           // This test relies on specific field access patterns, which we rewrite.
-          .put("064-field-access", TestCondition.match(TestCondition.R8_COMPILER))
+          .put("064-field-access",
+              TestCondition.match(
+                  TestCondition.R8_NOT_AFTER_D8_COMPILER,
+                  TestCondition.runtimes(DexVm.ART_4_4_4)))
+          .put("064-field-access",
+              TestCondition.match(
+                  TestCondition.R8_COMPILER,
+                  TestCondition.runtimes(
+                      DexVm.ART_DEFAULT, DexVm.ART_7_0_0, DexVm.ART_6_0_1, DexVm.ART_5_1_1)))
           // The growth limit test fails after processing by R8 because R8 will eliminate an
           // "unneeded" const store. The following reflective call to the VM's GC will then see the
           // large array as still live and the subsequent allocations will fail to reach the desired
@@ -478,6 +503,104 @@
               TestCondition.match(
                   TestCondition.D8_COMPILER,
                   TestCondition.runtimes(DexVm.ART_7_0_0, DexVm.ART_6_0_1, DexVm.ART_5_1_1)))
+          // Dalvik fails on reading an uninitialized local.
+          .put(
+              "471-uninitialized-locals",
+              TestCondition.match(TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // Out of memory.
+          .put("152-dead-large-object",
+              TestCondition.match(TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // Cannot resolve exception handler. Interestingly, D8 generates different code in
+          // release mode (which is also the code generated by R8) which passes.
+          .put("111-unresolvable-exception",
+              TestCondition.match(
+                  TestCondition.D8_COMPILER,
+                  TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // Type not present.
+          .put("124-missing-classes",
+              TestCondition.match(TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // Failed creating vtable.
+          .put("587-inline-class-error",
+              TestCondition.match(TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // Failed creating vtable.
+          .put("595-error-class",
+              TestCondition.match(TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // NoSuchFieldException: systemThreadGroup on Art 4.4.4.
+          .put("129-ThreadGetId",
+              TestCondition.match(TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // Verifier says: can't modify final field LMain;.staticFinalField.
+          .put("600-verifier-fails",
+              TestCondition.match(TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // VFY: args to if-eq/if-ne must both be refs or cat1
+          .put("134-reg-promotion",
+              TestCondition.match(TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // TODO(65355452): invoke-direct <init> on super only allowed for 'this' in <init>
+          .put("003-omnibus-opcodes",
+              TestCondition.match(
+                  TestCondition.R8_NOT_AFTER_D8_COMPILER,
+                  TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // TODO(65355452): invoke-direct <init> on super only allowed for 'this' in <init>
+          .put("043-privates",
+              TestCondition.match(
+                  TestCondition.R8_NOT_AFTER_D8_COMPILER,
+                  TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // TODO(65355452): invoke-direct <init> on super only allowed for 'this' in <init>
+          .put("589-super-imt",
+              TestCondition.match(
+                  TestCondition.R8_NOT_AFTER_D8_COMPILER,
+                  TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // TODO(65355452): invoke-direct <init> on super only allowed for 'this' in <init>
+          .put("494-checker-instanceof-tests",
+              TestCondition.match(
+                  TestCondition.R8_NOT_AFTER_D8_COMPILER,
+                  TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // TODO(65355452): invoke-direct <init> on super only allowed for 'this' in <init>
+          .put("422-instanceof",
+              TestCondition.match(
+                  TestCondition.R8_NOT_AFTER_D8_COMPILER,
+                  TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // TODO(65355452): invoke-direct <init> on super only allowed for 'this' in <init>
+          .put("424-checkcast",
+              TestCondition.match(
+                  TestCondition.R8_NOT_AFTER_D8_COMPILER,
+                  TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // TODO(65355452): invoke-direct <init> on super only allowed for 'this' in <init>
+          .put("495-checker-checkcast-tests",
+              TestCondition.match(
+                  TestCondition.R8_NOT_AFTER_D8_COMPILER,
+                  TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // TODO(65355452): invoke-direct <init> on super only allowed for 'this' in <init>
+          .put("576-polymorphic-inlining",
+              TestCondition.match(
+                  TestCondition.R8_NOT_AFTER_D8_COMPILER,
+                  TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // TODO(65355452): invoke-direct <init> on super only allowed for 'this' in <init>
+          .put("578-polymorphic-inlining",
+              TestCondition.match(
+                  TestCondition.R8_NOT_AFTER_D8_COMPILER,
+                  TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // TODO(65355452): invoke-direct <init> on super only allowed for 'this' in <init>
+          .put("631-checker-get-class",
+              TestCondition.match(
+                  TestCondition.R8_NOT_AFTER_D8_COMPILER,
+                  TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // TODO(65355452): invoke-direct <init> on super only allowed for 'this' in <init>
+          .put("633-checker-rtp-getclass",
+              TestCondition.match(
+                  TestCondition.R8_NOT_AFTER_D8_COMPILER,
+                  TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // VFY: tried to get class from non-ref register.
+          .put("506-verify-aput",
+              TestCondition.match(TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // NoSuchMethod: startMethodTracing.
+          .put("545-tracing-and-jit",
+              TestCondition.match(TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // filled-new-array arg 0(1) not valid.
+          .put("412-new-array",
+              TestCondition.match(TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // TODO(ager): unclear what is failing here.
+          .put("098-ddmc",
+              TestCondition.match(TestCondition.runtimes(DexVm.ART_4_4_4)))
           // Unsatisfiable link error:
           // libarttest.so: undefined symbol: _ZN3art6Thread18RunEmptyCheckpointEv
           .put(
@@ -485,6 +608,9 @@
               TestCondition.match(
                   TestCondition.D8_COMPILER,
                   TestCondition.runtimes(DexVm.ART_7_0_0, DexVm.ART_6_0_1, DexVm.ART_5_1_1)))
+          // lib64 libarttest.so: wrong ELF class ELFCLASS64.
+          .put("543-env-long-ref",
+              TestCondition.match(TestCondition.runtimes(DexVm.ART_4_4_4)))
           // Regression test for an issue that is not fixed on version 5.1.1. Throws an Exception
           // instance instead of the expected NullPointerException. This bug is only tickled when
           // running the R8 generated code when starting from jar or from dex code generated with
@@ -509,16 +635,20 @@
   // checked into the Art repo.
   private static final Multimap<String, TestCondition> failingRunWithArtOutput =
       new ImmutableListMultimap.Builder<String, TestCondition>()
+          // TODO(ager): Different output on R8 but only from jar frontend.
+          .put("068-classloader",
+              TestCondition.match(
+                  TestCondition.R8_NOT_AFTER_D8_COMPILER,
+                  TestCondition.runtimes(DexVm.ART_4_4_4)))
+          // On Art 4.4.4 we have 7 refs instead of 9.
+          .put("072-precise-gc",
+              TestCondition.match(TestCondition.runtimes(DexVm.ART_4_4_4)))
           // This one is expected to have different output. It counts instances, but the list that
           // keeps the instances alive is dead and could be garbage collected. The compiler reuses
           // the register for the list and therefore there are no live instances.
           .put("099-vmdebug", TestCondition.any())
           // This test relies on output on stderr, which we currently do not collect.
           .put("143-string-value", TestCondition.any())
-          // This one is expected to have different output. It counts instances, but the list that
-          // keeps the instances alive is dead and could be garbage collected. The compiler reuses
-          // the register for the list and therefore there are no live instances.
-          .put("099-vmdebug", TestCondition.any())
           .put(
               "800-smali",
               TestCondition.match(
@@ -1541,7 +1671,8 @@
       }
 
       File expectedFile = specification.resolveFile("expected.txt");
-      String expected = com.google.common.io.Files.toString(expectedFile, Charsets.UTF_8);
+      String expected =
+          com.google.common.io.Files.asCharSource(expectedFile, Charsets.UTF_8).read();
       if (specification.failsWithArt) {
         thrown.expect(AssertionError.class);
       }
diff --git a/tools/test.py b/tools/test.py
index c0a1e02..0cd8296 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -16,7 +16,7 @@
 import uuid
 import notify
 
-ALL_ART_VMS = ["default", "7.0.0", "6.0.1", "5.1.1"]
+ALL_ART_VMS = ["default", "7.0.0", "6.0.1", "5.1.1", "4.4.4"]
 BUCKET = 'r8-test-results'
 
 def ParseOptions():