#!/bin/bash
#
# Copyright (C) 2007 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Set up prog to be the path of this script, including following symlinks,
# and set up progdir to be the fully-qualified pathname of its directory.
prog="$0"
args="$@"
while [ -h "${prog}" ]; do
    newProg=`/bin/ls -ld "${prog}"`
    newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
    if expr "x${newProg}" : 'x/' >/dev/null; then
        prog="${newProg}"
    else
        progdir=`dirname "${prog}"`
        prog="${progdir}/${newProg}"
    fi
done
oldwd=`pwd`
progdir=`dirname "${prog}"`
cd "${progdir}"
progdir=`pwd`
prog="${progdir}"/`basename "${prog}"`
test_dir="test-$$"
if [ -z "$TMPDIR" ]; then
  tmp_dir="/tmp/$USER/${test_dir}"
else
  tmp_dir="${TMPDIR}/${test_dir}"
fi
checker="${progdir}/../tools/checker/checker.py"
export JAVA="java"
export JAVAC="javac -g -Xlint:-options"
export RUN="${progdir}/etc/run-test-jar"
export DEX_LOCATION=/data/run-test/${test_dir}
export NEED_DEX="true"
export USE_JACK="true"
export SMALI_ARGS="--experimental"

# If dx was not set by the environment variable, assume it is in the path.
if [ -z "$DX" ]; then
  export DX="dx"
fi

# If jasmin was not set by the environment variable, assume it is in the path.
if [ -z "$JASMIN" ]; then
  export JASMIN="jasmin"
fi

# If smali was not set by the environment variable, assume it is in the path.
if [ -z "$SMALI" ]; then
  export SMALI="smali"
fi

# If dexmerger was not set by the environment variable, assume it is in the path.
if [ -z "$DXMERGER" ]; then
  export DXMERGER="dexmerger"
fi

# If jack was not set by the environment variable, assume it is in the path.
if [ -z "$JACK" ]; then
  export JACK="jack"
fi

# ANDROID_BUILD_TOP is not set in a build environment.
if [ -z "$ANDROID_BUILD_TOP" ]; then
    export ANDROID_BUILD_TOP=$oldwd
fi

# ANDROID_HOST_OUT is not set in a build environment.
if [ -z "$ANDROID_HOST_OUT" ]; then
    export ANDROID_HOST_OUT=${OUT_DIR:-$ANDROID_BUILD_TOP/out/}host/linux-x86
fi

# If JACK_CLASSPATH is not set, assume it only contains core-libart.
if [ -z "$JACK_CLASSPATH" ]; then
  export JACK_CLASSPATH="${ANDROID_HOST_OUT}/../common/obj/JAVA_LIBRARIES/core-libart-hostdex_intermediates/classes.jack:${ANDROID_HOST_OUT}/../common/obj/JAVA_LIBRARIES/core-oj-hostdex_intermediates/classes.jack"
fi

export JACK="$JACK -g -cp $JACK_CLASSPATH"

info="info.txt"
build="build"
run="run"
expected="expected.txt"
check_cmd="check"
output="output.txt"
build_output="build-output.txt"
cfg_output="graph.cfg"
strace_output="strace-output.txt"
lib="libartd.so"
testlib="arttestd"
run_args="--quiet"
build_args=""

quiet="no"
debuggable="no"
prebuild_mode="yes"
target_mode="yes"
dev_mode="no"
update_mode="no"
debug_mode="no"
relocate="yes"
runtime="art"
usage="no"
build_only="no"
suffix64=""
trace="false"
trace_stream="false"
basic_verify="false"
gc_verify="false"
gc_stress="false"
strace="false"
always_clean="no"
never_clean="no"
have_dex2oat="yes"
have_patchoat="yes"
have_image="yes"
pic_image_suffix=""
multi_image_suffix=""
android_root="/system"
# By default we will use optimizing.
image_args=""
image_suffix="-optimizing"

while true; do
    if [ "x$1" = "x--host" ]; then
        target_mode="no"
        DEX_LOCATION=$tmp_dir
        run_args="${run_args} --host"
        shift
    elif [ "x$1" = "x--quiet" ]; then
        quiet="yes"
        shift
    elif [ "x$1" = "x--use-java-home" ]; then
        if [ -n "${JAVA_HOME}" ]; then
          export JAVA="${JAVA_HOME}/bin/java"
          export JAVAC="${JAVA_HOME}/bin/javac -g"
        else
          echo "Passed --use-java-home without JAVA_HOME variable set!"
          usage="yes"
        fi
        shift
    elif [ "x$1" = "x--jvm" ]; then
        target_mode="no"
        runtime="jvm"
        image_args=""
        prebuild_mode="no"
        NEED_DEX="false"
        USE_JACK="false"
        run_args="${run_args} --jvm"
        build_args="${build_args} --jvm"
        shift
    elif [ "x$1" = "x-O" ]; then
        lib="libart.so"
        testlib="arttest"
        shift
    elif [ "x$1" = "x--dalvik" ]; then
        lib="libdvm.so"
        runtime="dalvik"
        shift
    elif [ "x$1" = "x--no-dex2oat" ]; then
        have_dex2oat="no"
        shift
    elif [ "x$1" = "x--no-patchoat" ]; then
        have_patchoat="no"
        shift
    elif [ "x$1" = "x--no-image" ]; then
        have_image="no"
        shift
    elif [ "x$1" = "x--pic-image" ]; then
        pic_image_suffix="-pic"
        shift
    elif [ "x$1" = "x--multi-image" ]; then
        multi_image_suffix="-multi"
        shift
    elif [ "x$1" = "x--pic-test" ]; then
        run_args="${run_args} --pic-test"
        shift
    elif [ "x$1" = "x--relocate" ]; then
        relocate="yes"
        shift
    elif [ "x$1" = "x--no-relocate" ]; then
        relocate="no"
        shift
    elif [ "x$1" = "x--prebuild" ]; then
        run_args="${run_args} --prebuild"
        prebuild_mode="yes"
        shift;
    elif [ "x$1" = "x--strip-dex" ]; then
        run_args="${run_args} --strip-dex"
        shift;
    elif [ "x$1" = "x--debuggable" ]; then
        run_args="${run_args} -Xcompiler-option --debuggable"
        debuggable="yes"
        shift;
    elif [ "x$1" = "x--no-prebuild" ]; then
        run_args="${run_args} --no-prebuild"
        prebuild_mode="no"
        shift;
    elif [ "x$1" = "x--gcverify" ]; then
        basic_verify="true"
        gc_verify="true"
        shift
    elif [ "x$1" = "x--gcstress" ]; then
        basic_verify="true"
        gc_stress="true"
        shift
    elif [ "x$1" = "x--image" ]; then
        shift
        image="$1"
        run_args="${run_args} --image $image"
        shift
    elif [ "x$1" = "x-Xcompiler-option" ]; then
        shift
        option="$1"
        run_args="${run_args} -Xcompiler-option $option"
        shift
    elif [ "x$1" = "x--runtime-option" ]; then
        shift
        option="$1"
        run_args="${run_args} --runtime-option $option"
        shift
    elif [ "x$1" = "x--gdb-arg" ]; then
        shift
        gdb_arg="$1"
        run_args="${run_args} --gdb-arg $gdb_arg"
        shift
    elif [ "x$1" = "x--debug" ]; then
        run_args="${run_args} --debug"
        shift
    elif [ "x$1" = "x--gdb" ]; then
        run_args="${run_args} --gdb"
        dev_mode="yes"
        shift
    elif [ "x$1" = "x--strace" ]; then
        strace="yes"
        run_args="${run_args} --timeout 1800 --invoke-with strace --invoke-with -o --invoke-with $tmp_dir/$strace_output"
        shift
    elif [ "x$1" = "x--zygote" ]; then
        run_args="${run_args} --zygote"
        shift
    elif [ "x$1" = "x--interpreter" ]; then
        run_args="${run_args} --interpreter"
        image_suffix="-interpreter"
        shift
    elif [ "x$1" = "x--jit" ]; then
        image_args="--jit"
        image_suffix="-jit"
        shift
    elif [ "x$1" = "x--optimizing" ]; then
        image_args="-Xcompiler-option --compiler-backend=Optimizing"
        image_suffix="-optimizing"
        shift
    elif [ "x$1" = "x--no-verify" ]; then
        run_args="${run_args} --no-verify"
        shift
    elif [ "x$1" = "x--verify-soft-fail" ]; then
        image_args="--verify-soft-fail"
        image_suffix="-interp-ac"
        shift
    elif [ "x$1" = "x--no-optimize" ]; then
        run_args="${run_args} --no-optimize"
        shift
    elif [ "x$1" = "x--no-precise" ]; then
        run_args="${run_args} --no-precise"
        shift
    elif [ "x$1" = "x--invoke-with" ]; then
        shift
        what="$1"
        if [ "x$what" = "x" ]; then
            echo "$0 missing argument to --invoke-with" 1>&2
            usage="yes"
            break
        fi
        run_args="${run_args} --invoke-with ${what}"
        shift
    elif [ "x$1" = "x--dev" ]; then
        run_args="${run_args} --dev"
        dev_mode="yes"
        shift
    elif [ "x$1" = "x--build-only" ]; then
        build_only="yes"
        shift
    elif [ "x$1" = "x--build-with-javac-dx" ]; then
        USE_JACK="false"
        shift
    elif [ "x$1" = "x--build-with-jack" ]; then
        USE_JACK="true"
        shift
    elif [ "x$1" = "x--output-path" ]; then
        shift
        tmp_dir=$1
        if [ "x$tmp_dir" = "x" ]; then
            echo "$0 missing argument to --output-path" 1>&2
            usage="yes"
            break
        fi
        shift
    elif [ "x$1" = "x--android-root" ]; then
        shift
        if [ "x$1" = "x" ]; then
            echo "$0 missing argument to --android-root" 1>&2
            usage="yes"
            break
        fi
        android_root="$1"
        run_args="${run_args} --android-root $1"
        shift
    elif [ "x$1" = "x--update" ]; then
        update_mode="yes"
        shift
    elif [ "x$1" = "x--help" ]; then
        usage="yes"
        shift
    elif [ "x$1" = "x--64" ]; then
        run_args="${run_args} --64"
        suffix64="64"
        shift
    elif [ "x$1" = "x--trace" ]; then
        trace="true"
        shift
    elif [ "x$1" = "x--stream" ]; then
        trace_stream="true"
        shift
    elif [ "x$1" = "x--always-clean" ]; then
        always_clean="yes"
        shift
    elif [ "x$1" = "x--never-clean" ]; then
        never_clean="yes"
        shift
    elif [ "x$1" = "x--dex2oat-swap" ]; then
        run_args="${run_args} --dex2oat-swap"
        shift
    elif [ "x$1" = "x--instruction-set-features" ]; then
        shift
        run_args="${run_args} --instruction-set-features $1"
        shift
    elif expr "x$1" : "x--" >/dev/null 2>&1; then
        echo "unknown $0 option: $1" 1>&2
        usage="yes"
        break
    else
        break
    fi
done

run_args="${run_args} ${image_args}"
# Allocate file descriptor real_stderr and redirect it to the shell's error
# output (fd 2).
if [ ${BASH_VERSINFO[1]} -ge 4 ] && [ ${BASH_VERSINFO[2]} -ge 1 ]; then
  exec {real_stderr}>&2
else
  # In bash before version 4.1 we need to do a manual search for free file
  # descriptors.
  FD=3
  while [ -e /dev/fd/$FD ]; do FD=$((FD + 1)); done
  real_stderr=$FD
  eval "exec ${real_stderr}>&2"
fi
if [ "$quiet" = "yes" ]; then
  # Force the default standard output and error to go to /dev/null so we will
  # not print them.
  exec 1>/dev/null
  exec 2>/dev/null
fi

function err_echo() {
  echo "$@" 1>&${real_stderr}
}

# tmp_dir may be relative, resolve.
#
# Cannot use realpath, as it does not exist on Mac.
# Cannot us a simple "cd", as the path might not be created yet.
# Cannot use readlink -m, as it does not exist on Mac.
# Fallback to nuclear option:
noncanonical_tmp_dir=$tmp_dir
tmp_dir="`cd $oldwd ; python -c "import os; print os.path.realpath('$tmp_dir')"`"
mkdir -p $tmp_dir

if [ "$basic_verify" = "true" ]; then
  # Set HspaceCompactForOOMMinIntervalMs to zero to run hspace compaction for OOM more frequently in tests.
  run_args="${run_args} --runtime-option -Xgc:preverify --runtime-option -Xgc:postverify --runtime-option -XX:HspaceCompactForOOMMinIntervalMs=0"
fi
if [ "$gc_verify" = "true" ]; then
  run_args="${run_args} --runtime-option -Xgc:preverify_rosalloc --runtime-option -Xgc:postverify_rosalloc"
fi
if [ "$gc_stress" = "true" ]; then
  run_args="${run_args} --gc-stress --runtime-option -Xgc:SS,gcstress --runtime-option -Xms2m --runtime-option -Xmx16m"
fi
if [ "$trace" = "true" ]; then
    run_args="${run_args} --runtime-option -Xmethod-trace --runtime-option -Xmethod-trace-file-size:2000000"
    if [ "$trace_stream" = "true" ]; then
        # Streaming mode uses the file size as the buffer size. So output gets really large. Drop
        # the ability to analyze the file and just write to /dev/null.
        run_args="${run_args} --runtime-option -Xmethod-trace-file:/dev/null"
        # Enable streaming mode.
        run_args="${run_args} --runtime-option -Xmethod-trace-stream"
    else
        run_args="${run_args} --runtime-option -Xmethod-trace-file:${DEX_LOCATION}/trace.bin"
    fi
elif [ "$trace_stream" = "true" ]; then
    err_echo "Cannot use --stream without --trace."
    exit 1
fi

# Most interesting target architecture variables are Makefile variables, not environment variables.
# Try to map the suffix64 flag and what we find in ${ANDROID_PRODUCT_OUT}/data/art-test to an architecture name.
function guess_target_arch_name() {
    grep32bit=`ls ${ANDROID_PRODUCT_OUT}/data/art-test | grep -E '^(arm|x86|mips)$'`
    grep64bit=`ls ${ANDROID_PRODUCT_OUT}/data/art-test | grep -E '^(arm64|x86_64|mips64)$'`
    if [ "x${suffix64}" = "x64" ]; then
        target_arch_name=${grep64bit}
    else
        target_arch_name=${grep32bit}
    fi
}

function guess_host_arch_name() {
    if [ "x${suffix64}" = "x64" ]; then
        host_arch_name="x86_64"
    else
        host_arch_name="x86"
    fi
}

if [ "$target_mode" = "no" ]; then
    if [ "$runtime" = "jvm" ]; then
        if [ "$prebuild_mode" = "yes" ]; then
            err_echo "--prebuild with --jvm is unsupported"
            exit 1;
        fi
    fi
fi

if [ "$have_patchoat" = "no" ]; then
  run_args="${run_args} --no-patchoat"
fi

if [ "$have_dex2oat" = "no" ]; then
  run_args="${run_args} --no-dex2oat"
fi

if [ ! "$runtime" = "jvm" ]; then
  run_args="${run_args} --lib $lib"
fi

if [ "$runtime" = "dalvik" ]; then
    if [ "$target_mode" = "no" ]; then
        framework="${ANDROID_PRODUCT_OUT}/system/framework"
        bpath="${framework}/core-libart.jar:${framework}/core-oj.jar:${framework}/conscrypt.jar:${framework}/okhttp.jar:${framework}/bouncycastle.jar:${framework}/ext.jar"
        run_args="${run_args} --boot --runtime-option -Xbootclasspath:${bpath}"
    else
        true # defaults to using target BOOTCLASSPATH
    fi
elif [ "$runtime" = "art" ]; then
    if [ "$target_mode" = "no" ]; then
        guess_host_arch_name
        run_args="${run_args} --boot ${ANDROID_HOST_OUT}/framework/core${image_suffix}${pic_image_suffix}${multi_image_suffix}.art"
        run_args="${run_args} --runtime-option -Djava.library.path=${ANDROID_HOST_OUT}/lib${suffix64}"
    else
        guess_target_arch_name
        run_args="${run_args} --runtime-option -Djava.library.path=/data/art-test/${target_arch_name}:/system/lib${suffix64}"
        run_args="${run_args} --boot /data/art-test/core${image_suffix}${pic_image_suffix}${multi_image_suffix}.art"
    fi
    if [ "$relocate" = "yes" ]; then
      run_args="${run_args} --relocate"
    else
      run_args="${run_args} --no-relocate"
    fi
elif [ "$runtime" = "jvm" ]; then
    # TODO: Detect whether the host is 32-bit or 64-bit.
    run_args="${run_args} --runtime-option -Djava.library.path=${ANDROID_HOST_OUT}/lib64"
fi

if [ "$have_image" = "no" ]; then
    if [ "$runtime" != "art" ]; then
        err_echo "--no-image is only supported on the art runtime"
        exit 1
    fi
    if [ "$target_mode" = "no" ]; then
        framework="${ANDROID_HOST_OUT}/framework"
        bpath_suffix="-hostdex"
    else
        framework="${android_root}/framework"
        bpath_suffix=""
    fi
    # TODO If the target was compiled WITH_DEXPREOPT=true then these tests will
    # fail since these jar files will be stripped.
    bpath="${framework}/core-libart${bpath_suffix}.jar"
    bpath="${bpath}:${framework}/core-oj${bpath_suffix}.jar"
    bpath="${bpath}:${framework}/conscrypt${bpath_suffix}.jar"
    bpath="${bpath}:${framework}/okhttp${bpath_suffix}.jar"
    bpath="${bpath}:${framework}/bouncycastle${bpath_suffix}.jar"
    # Pass down the bootclasspath
    run_args="${run_args} --runtime-option -Xbootclasspath:${bpath}"
    run_args="${run_args} --no-image"
fi

if [ "$dev_mode" = "yes" -a "$update_mode" = "yes" ]; then
    err_echo "--dev and --update are mutually exclusive"
    usage="yes"
fi

if [ "$dev_mode" = "yes" -a "$quiet" = "yes" ]; then
    err_echo "--dev and --quiet are mutually exclusive"
    usage="yes"
fi

if [ "$usage" = "no" ]; then
    if [ "x$1" = "x" -o "x$1" = "x-" ]; then
        test_dir=`basename "$oldwd"`
    else
        test_dir="$1"
    fi

    if [ '!' -d "$test_dir" ]; then
        td2=`echo ${test_dir}-*`
        if [ '!' -d "$td2" ]; then
            err_echo "${test_dir}: no such test directory"
            usage="yes"
        fi
        test_dir="$td2"
    fi
    # Shift to get rid of the test name argument. The rest of the arguments
    # will get passed to the test run.
    shift
fi

if [ "$usage" = "yes" ]; then
    prog=`basename $prog`
    (
        echo "usage:"
        echo "  $prog --help                          Print this message."
        echo "  $prog [options] [test-name]           Run test normally."
        echo "  $prog --dev [options] [test-name]     Development mode" \
             "(dumps to stdout)."
        echo "  $prog --update [options] [test-name]  Update mode" \
             "(replaces expected.txt)."
        echo '  Omitting the test name or specifying "-" will use the' \
             "current directory."
        echo "  Runtime Options:"
        echo "    -O                    Run non-debug rather than debug build (off by default)."
        echo "    -Xcompiler-option     Pass an option to the compiler."
        echo "    --runtime-option      Pass an option to the runtime."
        echo "    --debug               Wait for a debugger to attach."
        echo "    --debuggable          Whether to compile Java code for a debugger."
        echo "    --gdb                 Run under gdb; incompatible with some tests."
        echo "    --gdb-arg             Pass an option to gdb."
        echo "    --build-only          Build test files only (off by default)."
        echo "    --build-with-javac-dx Build test files with javac and dx (on by default)."
        echo "    --build-with-jack     Build test files with jack and jill (off by default)."
        echo "    --interpreter         Enable interpreter only mode (off by default)."
        echo "    --jit                 Enable jit (off by default)."
        echo "    --optimizing          Enable optimizing compiler (default)."
        echo "    --no-verify           Turn off verification (on by default)."
        echo "    --verify-soft-fail    Force soft fail verification (off by default)."
        echo "                          Verification is enabled if neither --no-verify"
        echo "                          nor --verify-soft-fail is specified."
        echo "    --no-optimize         Turn off optimization (on by default)."
        echo "    --no-precise          Turn off precise GC (on by default)."
        echo "    --zygote              Spawn the process from the Zygote." \
             "If used, then the"
        echo "                          other runtime options are ignored."
        echo "    --no-dex2oat          Run as though dex2oat was failing."
        echo "    --no-patchoat         Run as though patchoat was failing."
        echo "    --prebuild            Run dex2oat on the files before starting test. (default)"
        echo "    --no-prebuild         Do not run dex2oat on the files before starting"
        echo "                          the test."
        echo "    --strip-dex           Strip the dex files before starting test."
        echo "    --relocate            Force the use of relocating in the test, making"
        echo "                          the image and oat files be relocated to a random"
        echo "                          address before running. (default)"
        echo "    --no-relocate         Force the use of no relocating in the test"
        echo "    --image               Run the test using a precompiled boot image. (default)"
        echo "    --no-image            Run the test without a precompiled boot image."
        echo "    --host                Use the host-mode virtual machine."
        echo "    --invoke-with         Pass --invoke-with option to runtime."
        echo "    --dalvik              Use Dalvik (off by default)."
        echo "    --jvm                 Use a host-local RI virtual machine."
        echo "    --use-java-home       Use the JAVA_HOME environment variable"
        echo "                          to find the java compiler and runtime"
        echo "                          (if applicable) to run the test with."
        echo "    --output-path [path]  Location where to store the build" \
             "files."
        echo "    --64                  Run the test in 64-bit mode"
        echo "    --trace               Run with method tracing"
        echo "    --strace              Run with syscall tracing from strace."
        echo "    --stream              Run method tracing in streaming mode (requires --trace)"
        echo "    --gcstress            Run with gc stress testing"
        echo "    --gcverify            Run with gc verification"
        echo "    --always-clean        Delete the test files even if the test fails."
        echo "    --never-clean         Keep the test files even if the test succeeds."
        echo "    --android-root [path] The path on target for the android root. (/system by default)."
        echo "    --dex2oat-swap        Use a dex2oat swap file."
        echo "    --instruction-set-features [string]"
        echo "                          Set instruction-set-features for compilation."
        echo "    --pic-image           Use an image compiled with position independent code for the"
        echo "                          boot class path."
        echo "    --multi-image         Use a set of images compiled with dex2oat multi-image for"
        echo "                          the boot class path."
        echo "    --pic-test            Compile the test code position independent."
        echo "    --quiet               Don't print anything except failure messages"
    ) 1>&2  # Direct to stderr so usage is not printed if --quiet is set.
    exit 1
fi

cd "$test_dir"
test_dir=`pwd`

td_info="${test_dir}/${info}"
td_expected="${test_dir}/${expected}"

if [ ! -r $td_info ]; then
    err_echo "${test_dir}: missing file $td_info"
    exit 1
fi

if [ ! -r $td_expected ]; then
    err_echo "${test_dir}: missing file $td_expected"
    exit 1
fi

# copy the test to a temp dir and run it

echo "${test_dir}: building..." 1>&2

rm -rf "$tmp_dir"
cp -Rp "$test_dir" "$tmp_dir"
cd "$tmp_dir"

if [ '!' -r "$build" ]; then
    cp "${progdir}/etc/default-build" build
else
    cp "${progdir}/etc/default-build" .
fi

if [ '!' -r "$run" ]; then
    cp "${progdir}/etc/default-run" run
else
    cp "${progdir}/etc/default-run" .
fi

if [ '!' -r "$check_cmd" ]; then
    cp "${progdir}/etc/default-check" check
else
    cp "${progdir}/etc/default-check" .
fi

chmod 755 "$build"
chmod 755 "$run"
chmod 755 "$check_cmd"

export TEST_NAME=`basename ${test_dir}`

# arch_supports_read_barrier ARCH
# -------------------------------
# Return whether the Optimizing compiler has read barrier support for ARCH.
function arch_supports_read_barrier() {
  # Optimizing has read barrier support for ARM, ARM64, x86 and x86-64 at the
  # moment.
  [ "x$1" = xarm ] || [ "x$1" = xarm64 ] || [ "x$1" = xx86 ] || [ "x$1" = xx86_64 ]
}

# Tests named '<number>-checker-*' will also have their CFGs verified with
# Checker when compiled with Optimizing on host.
if [[ "$TEST_NAME" =~ ^[0-9]+-checker- ]]; then
  if [ "$runtime" = "art" -a "$image_suffix" = "-optimizing" -a "$USE_JACK" = "true" ]; then
    # Optimizing has read barrier support for certain architectures
    # only. On other architectures, compiling is disabled when read
    # barriers are enabled, meaning that we do not produce a CFG file
    # as a side-effect of compilation, thus the Checker assertions
    # cannot be checked. Disable Checker for those cases.
    #
    # TODO: Enable Checker when read barrier support is added to more
    # architectures (b/12687968).
    if [ "x$ART_USE_READ_BARRIER" = xtrue ]                    \
       && (([ "x$host_mode" = "xyes" ]                         \
            && ! arch_supports_read_barrier "$host_arch_name") \
           || ([ "x$target_mode" = "xyes" ]                    \
               && ! arch_supports_read_barrier "$target_arch_name")); then
      run_checker="no"
    # In no-prebuild mode, the compiler is only invoked if both dex2oat and
    # patchoat are available. Disable Checker otherwise (b/22552692).
    elif [ "$prebuild_mode" = "yes" ] \
         || [ "$have_patchoat" = "yes" -a "$have_dex2oat" = "yes" ]; then
      run_checker="yes"

      if [ "$target_mode" = "no" ]; then
        cfg_output_dir="$tmp_dir"
        checker_args="--arch=${host_arch_name^^}"
      else
        cfg_output_dir="$DEX_LOCATION"
        checker_args="--arch=${target_arch_name^^}"
      fi

      if [ "$debuggable" = "yes" ]; then
        checker_args="$checker_args --debuggable"
      fi

      run_args="${run_args} -Xcompiler-option --dump-cfg=$cfg_output_dir/$cfg_output \
                            -Xcompiler-option -j1"
    fi
  fi
fi

if [ "$runtime" != "jvm" ]; then
  run_args="${run_args} --testlib ${testlib}"
fi

# To cause tests to fail fast, limit the file sizes created by dx, dex2oat and ART output to 2MB.
build_file_size_limit=2048
run_file_size_limit=2048

# Add tests requiring a higher ulimit to this list. Ulimits might need to be raised to deal with
# large amounts of expected output or large generated files.
if echo "$test_dir" | grep -Eq "(083|089|961|964|971)" > /dev/null; then
  build_file_size_limit=5120
  run_file_size_limit=5120
fi
if [ "$run_checker" = "yes" -a "$target_mode" = "yes" ]; then
  # We will need to `adb pull` the .cfg output from the target onto the host to
  # run checker on it. This file can be big.
  build_file_size_limit=24576
  run_file_size_limit=24576
fi
if [ ${USE_JACK} = "false" ]; then
  # Set ulimit if we build with dx only, Jack can generate big temp files.
  if ! ulimit -S "$build_file_size_limit"; then
    err_echo "ulimit file size setting failed"
  fi
fi

good="no"
good_build="yes"
good_run="yes"
if [ "$dev_mode" = "yes" ]; then
    "./${build}" $build_args 2>&1
    build_exit="$?"
    echo "build exit status: $build_exit" 1>&2
    if [ "$build_exit" = '0' ]; then
        if ! ulimit -S "$run_file_size_limit"; then
          err_echo "ulimit file size setting failed"
        fi
        echo "${test_dir}: running..." 1>&2
        "./${run}" $run_args "$@" 2>&1
        run_exit="$?"

        if [ "$run_exit" = "0" ]; then
            if [ "$run_checker" = "yes" ]; then
                if [ "$target_mode" = "yes" ]; then
                  adb pull $cfg_output_dir/$cfg_output &> /dev/null
                fi
                "$checker" $checker_args "$cfg_output" "$tmp_dir" 2>&1
                checker_exit="$?"
                if [ "$checker_exit" = "0" ]; then
                    good="yes"
                fi
                err_echo "checker exit status: $checker_exit"
            else
                good="yes"
            fi
        fi
        echo "run exit status: $run_exit" 1>&2
    fi
elif [ "$update_mode" = "yes" ]; then
    "./${build}" $build_args >"$build_output" 2>&1
    build_exit="$?"
    if [ "$build_exit" = '0' ]; then
        if ! ulimit -S "$run_file_size_limit"; then
          err_echo "ulimit file size setting failed"
        fi
        echo "${test_dir}: running..." 1>&2
        "./${run}" $run_args "$@" >"$output" 2>&1
        if [ "$run_checker" = "yes" ]; then
          if [ "$target_mode" = "yes" ]; then
            adb pull $cfg_output_dir/$cfg_output &> /dev/null
          fi
          "$checker" -q $checker_args "$cfg_output" "$tmp_dir" >> "$output" 2>&1
        fi
        sed -e 's/[[:cntrl:]]$//g' < "$output" >"${td_expected}"
        good="yes"
    else
        cat "$build_output" 1>&${real_stderr} 1>&2
        err_echo "build exit status: $build_exit"
    fi
elif [ "$build_only" = "yes" ]; then
    good="yes"
    "./${build}" $build_args >"$build_output" 2>&1
    build_exit="$?"
    if [ "$build_exit" '!=' '0' ]; then
        cp "$build_output" "$output"
        echo "build exit status: $build_exit" >>"$output"
        diff --strip-trailing-cr -q "$expected" "$output" >/dev/null
        if [ "$?" '!=' "0" ]; then
            good="no"
            err_echo "BUILD FAILED For ${TEST_NAME}"
        fi
    fi
    # Clean up extraneous files that are not used by tests.
    find $tmp_dir -mindepth 1  ! -regex ".*/\(.*jar\|$output\|$expected\)" | xargs rm -rf
    exit 0
else
    "./${build}" $build_args >"$build_output" 2>&1
    build_exit="$?"
    if [ "$build_exit" = '0' ]; then
        if ! ulimit -S "$run_file_size_limit"; then
          err_echo "ulimit file size setting failed"
        fi
        echo "${test_dir}: running..." 1>&2
        "./${run}" $run_args "$@" >"$output" 2>&1
        run_exit="$?"
        if [ "$run_exit" != "0" ]; then
            err_echo "run exit status: $run_exit"
            good_run="no"
        elif [ "$run_checker" = "yes" ]; then
            if [ "$target_mode" = "yes" ]; then
              adb pull $cfg_output_dir/$cfg_output &> /dev/null
            fi
            "$checker" -q $checker_args "$cfg_output" "$tmp_dir" >> "$output" 2>&1
            checker_exit="$?"
            if [ "$checker_exit" != "0" ]; then
                err_echo "checker exit status: $checker_exit"
                good_run="no"
            else
                good_run="yes"
            fi
        else
            good_run="yes"
        fi
    else
        good_build="no"
        cp "$build_output" "$output"
        echo "Failed to build in tmpdir=${tmp_dir} from oldwd=${oldwd} and cwd=`pwd`" >> "$output"
        echo "Non-canonical tmpdir was ${noncanonical_tmp_dir}" >> "$output"
        echo "Args: ${args}" >> "$output"
        echo "build exit status: $build_exit" >> "$output"
        max_name_length=$(getconf NAME_MAX ${tmp_dir})
        echo "Max filename (NAME_MAX): ${max_name_length}" >> "$output"
        max_path_length=$(getconf PATH_MAX ${tmp_dir})
        echo "Max pathlength (PATH_MAX): ${max_path_length}" >> "$output"
    fi
    ./$check_cmd "$expected" "$output"
    if [ "$?" = "0" ]; then
        if [ "$good_build" = "no" -o "$good_run" = "yes" ]; then
          # output == expected
          good="yes"
          echo "${test_dir}: succeeded!" 1>&2
        fi
    fi
fi

(
    if [ "$good" != "yes" -a "$update_mode" != "yes" ]; then
        echo "${test_dir}: FAILED!"
        echo ' '
        echo '#################### info'
        cat "${td_info}" | sed 's/^/# /g'
        echo '#################### diffs'
        diff --strip-trailing-cr -u "$expected" "$output" | tail -n 3000
        echo '####################'
        if [ "$strace" = "yes" ]; then
            echo '#################### strace output'
            tail -n 3000 "$tmp_dir/$strace_output"
            echo '####################'
        fi
        echo ' '
    fi

) 2>&${real_stderr} 1>&2

# Clean up test files.
if [ "$always_clean" = "yes" -o "$good" = "yes" ] && [ "$never_clean" = "no" ]; then
    cd "$oldwd"
    rm -rf "$tmp_dir"
    if [ "$target_mode" = "yes" -a "$build_exit" = "0" ]; then
        adb shell rm -rf $DEX_LOCATION
    fi
    if [ "$good" = "yes" ]; then
        exit 0
    fi
fi


(
    if [ "$always_clean" = "yes" ]; then
        echo "${TEST_NAME} files deleted from host "
        if [ "$target_mode" == "yes" ]; then
            echo "and from target"
        fi
    else
        echo "${TEST_NAME} files left in ${tmp_dir} on host"
        if [ "$target_mode" == "yes" ]; then
            echo "and in ${DEX_LOCATION} on target"
        fi
    fi

) 2>&${real_stderr} 1>&2

if [ "$never_clean" = "yes" ] && [ "$good" = "yes" ]; then
  exit 0
else
  exit 1
fi
