Run CF backend on Art tests

This reverts commit c872f06b (2018-03-07) which reverted commit 66f599c1
("Run CF backend on Art tests", 2018-03-07).

Add CompilerUnderTest.D8_AFTER_R8CF for testing the combination of R8/CF
and D8. For tests that have both DEX and Classfile inputs, R8/CF
processes only the Classfile inputs, and D8 processes the DEX inputs
and the Classfile output of R8.

Add D8_AFTER_R8CF to TestCondition.R8_COMPILER and D8_COMPILER, since
these TestCondition cover cases where respectively R8 and D8 run.

Add TestCondition.R8DEX_COMPILER which covers only the cases when R8 is
run with the DEX backend.

Add TestCondition.D8_NOT_AFTER_R8CF_COMPILER which covers the cases when
D8 is run directly on Classfile inputs without involving R8/CF.

Add TestCondition.D8_AFTER_R8CF_COMPILER for tests involving R8/CF.

Change most instances of R8_COMPILER to R8DEX_COMPILER in lists of
expected exceptions, and add a few new expected exceptions for R8/CF.

Make create_art_tests.py generate Art test cases in
com.android.tools.r8.art.none.r8cf, but don't create any test cases
with DexTool.DX or JACK.

Change-Id: I82ea712184d8845d32c2603252e4262e6eb23ad4
diff --git a/tools/create_art_tests.py b/tools/create_art_tests.py
index feb36a2..13757a9 100755
--- a/tools/create_art_tests.py
+++ b/tools/create_art_tests.py
@@ -16,7 +16,7 @@
 JACK_TEST = os.path.join('tests', '2016-12-19', 'art')
 TEST_DIR = os.path.join('tests', '2017-10-04', 'art')
 TOOLCHAINS = ["dx", "jack", "none"]
-TOOLS = ["r8", "d8"]
+TOOLS = ["r8", "d8", "r8cf"]
 TEMPLATE = Template(
 """// Copyright (c) 2016, the R8 project authors. Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
@@ -54,6 +54,7 @@
     rmtree(toolchain_dir)
   makedirs(join(toolchain_dir, "d8"))
   makedirs(join(toolchain_dir, "r8"))
+  makedirs(join(toolchain_dir, "r8cf"))
 
 def write_file(toolchain, tool, class_name, contents):
   file_name = join(OUTPUT_DIR, toolchain, tool, class_name + ".java")
@@ -74,6 +75,10 @@
         tool_enum = 'R8_AFTER_D8'
       else:
         tool_enum = upper(tool)
+      if tool == "r8cf":
+        if toolchain != "none":
+          continue
+        tool_enum = 'D8_AFTER_R8CF'
       contents = TEMPLATE.substitute(
           name=dir,
           compilerUnderTestEnum=tool_enum,