Don't consume dx generated input in the examples test

The dx code is still build since we rely on this for comparison of the output.

We should have real expectations for these tests instead.

Bug: 185205222
Change-Id: Ief71089fb1dcf3616eb69cef75da2681bef7d99d
diff --git a/src/test/java/com/android/tools/r8/R8RunExamplesCommon.java b/src/test/java/com/android/tools/r8/R8RunExamplesCommon.java
index b247acf..08bb64b 100644
--- a/src/test/java/com/android/tools/r8/R8RunExamplesCommon.java
+++ b/src/test/java/com/android/tools/r8/R8RunExamplesCommon.java
@@ -17,7 +17,6 @@
 import com.android.tools.r8.utils.InternalOptions.LineNumberOptimization;
 import com.android.tools.r8.utils.TestDescriptionWatcher;
 import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
 import java.io.IOException;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -33,7 +32,9 @@
 public abstract class R8RunExamplesCommon {
 
   protected enum Input {
-    DX, JAVAC, JAVAC_ALL, JAVAC_NONE
+    JAVAC,
+    JAVAC_ALL,
+    JAVAC_NONE
   }
 
   protected enum Output {
@@ -90,8 +91,6 @@
 
   private Path getInputFile() {
     switch(input) {
-      case DX:
-        return getOriginalDexFile();
       case JAVAC:
         return getOriginalJarFile("");
       case JAVAC_ALL:
@@ -104,12 +103,7 @@
   }
 
   public R8Command.Builder addInputFile(R8Command.Builder builder) {
-    if (input == Input.DX) {
-      // If input is DEX code, use the tool helper to add the DEX sources as R8 disallows them.
-      ToolHelper.getAppBuilder(builder).addProgramFiles(getOriginalDexFile());
-    } else {
-      builder.addProgramFiles(getInputFile());
-    }
+    builder.addProgramFiles(getInputFile());
     return builder;
   }
 
@@ -121,10 +115,6 @@
     return Paths.get(getExampleDir(), pkg, ToolHelper.DEFAULT_DEX_FILENAME);
   }
 
-  private DexTool getTool() {
-    return input == Input.DX ? DexTool.DX : DexTool.NONE;
-  }
-
   @Rule
   public ExpectedException thrown = ExpectedException.none();
 
@@ -171,10 +161,6 @@
   }
 
   private boolean shouldCompileFail() {
-    if (input == Input.DX && getFailingCompileDxToDex().contains(mainClass)) {
-      assert output == Output.DEX;
-      return true;
-    }
     if (output == Output.CF && getFailingCompileCf().contains(mainClass)) {
       return true;
     }
@@ -212,7 +198,7 @@
 
     TestCondition condition =
         output == Output.CF ? getFailingRunCf().get(mainClass) : getFailingRun().get(mainClass);
-    if (condition != null && condition.test(getTool(), compiler, vm.getVersion(), mode)) {
+    if (condition != null && condition.test(DexTool.NONE, compiler, vm.getVersion(), mode)) {
       thrown.expect(Throwable.class);
     }
 
@@ -248,12 +234,12 @@
 
   private boolean shouldMatchJVMOutput(DexVm.Version version) {
     TestCondition condition = getOutputNotIdenticalToJVMOutput().get(mainClass);
-    return condition == null || !condition.test(getTool(), compiler, version, mode);
+    return condition == null || !condition.test(DexTool.NONE, compiler, version, mode);
   }
 
   private boolean shouldSkipVm(DexVm.Version version) {
     TestCondition condition = getSkip().get(mainClass);
-    return condition != null && condition.test(getTool(), compiler, version, mode);
+    return condition != null && condition.test(DexTool.NONE, compiler, version, mode);
   }
 
   protected abstract String getExampleDir();
@@ -264,10 +250,6 @@
 
   protected abstract Set<String> getFailingCompileCfToDex();
 
-  protected Set<String> getFailingCompileDxToDex() {
-    return ImmutableSet.of();
-  }
-
   // TODO(mathiasr): Add CompilerSet for CfToDex so we can fold this into getFailingRun().
   protected abstract Set<String> getFailingRunCfToDex();
 
diff --git a/src/test/java/com/android/tools/r8/R8RunExamplesTest.java b/src/test/java/com/android/tools/r8/R8RunExamplesTest.java
index d8a62da..922f2d3 100644
--- a/src/test/java/com/android/tools/r8/R8RunExamplesTest.java
+++ b/src/test/java/com/android/tools/r8/R8RunExamplesTest.java
@@ -95,7 +95,6 @@
           makeTest(Input.JAVAC_ALL, CompilerUnderTest.R8, CompilationMode.RELEASE, test));
       fullTestList.add(
           makeTest(Input.JAVAC_ALL, CompilerUnderTest.R8, CompilationMode.DEBUG, test));
-      fullTestList.add(makeTest(Input.DX, CompilerUnderTest.R8, CompilationMode.RELEASE, test));
       fullTestList.add(
           makeTest(
               Input.JAVAC_ALL, CompilerUnderTest.R8, CompilationMode.RELEASE, test, Output.CF));
@@ -158,12 +157,6 @@
   }
 
   @Override
-  protected Set<String> getFailingCompileDxToDex() {
-    return new ImmutableSet.Builder<String>()
-        .build();
-  }
-
-  @Override
   protected Set<String> getFailingCompileCf() {
     return new ImmutableSet.Builder<String>()
         .build();