ART: Create and use multiple core images

Update test infrastructure to understand several core variants.
Now compiles three core.art/oat variants:

* core.art/oat, default-compiled
* core-interpreter.art/oat, interpret-only
* core-optimizing.art/oat, optimizing compiler

The run-test variant implies which core variant is used.

Change-Id: Ieeaf2df90faee2b04c209b950897e77806205fe4
diff --git a/test/run-test b/test/run-test
index 9c97de0..b7c0ecf 100755
--- a/test/run-test
+++ b/test/run-test
@@ -95,6 +95,7 @@
 have_dex2oat="yes"
 have_patchoat="yes"
 have_image="yes"
+image_suffix=""
 
 while true; do
     if [ "x$1" = "x--host" ]; then
@@ -174,6 +175,11 @@
         shift
     elif [ "x$1" = "x--interpreter" ]; then
         run_args="${run_args} --interpreter"
+        image_suffix="-interpreter"
+        shift
+    elif [ "x$1" = "x--optimizing" ]; then
+        run_args="${run_args} -Xcompiler-option --compiler-backend=Optimizing"
+        image_suffix="-optimizing"
         shift
     elif [ "x$1" = "x--no-verify" ]; then
         run_args="${run_args} --no-verify"
@@ -308,12 +314,12 @@
         if [ -z "$ANDROID_HOST_OUT" ]; then
             export ANDROID_HOST_OUT=$ANDROID_BUILD_TOP/out/host/linux-x86
         fi
-        run_args="${run_args} --boot -Ximage:${ANDROID_HOST_OUT}/framework/core.art"
+        run_args="${run_args} --boot -Ximage:${ANDROID_HOST_OUT}/framework/core${image_suffix}.art"
         run_args="${run_args} --runtime-option -Djava.library.path=${ANDROID_HOST_OUT}/lib${suffix64}"
     else
         guess_arch_name
         run_args="${run_args} --runtime-option -Djava.library.path=/data/art-test/${target_arch_name}"
-        run_args="${run_args} --boot -Ximage:/data/art-test/core.art"
+        run_args="${run_args} --boot -Ximage:/data/art-test/core${image_suffix}.art"
     fi
     if [ "$relocate" = "yes" ]; then
       run_args="${run_args} --relocate"
@@ -391,6 +397,7 @@
         echo "    --gdb                Run under gdb; incompatible with some tests."
         echo "    --build-only         Build test files only (off by default)."
         echo "    --interpreter        Enable interpreter only mode (off by default)."
+        echo "    --optimizing         Enable optimizing compiler (off by default)."
         echo "    --no-verify          Turn off verification (on by default)."
         echo "    --no-optimize        Turn off optimization (on by default)."
         echo "    --no-precise         Turn off precise GC (on by default)."