Update ART run-tests for new Jack optimizations

Disables Jack's use/def optimization that breaks run-test
442-checker-constant-folding.

This is done by introducing the "--jack-option" argument in the
build script. Tests can now individually pass jack options (like test
442-checker-constant-folding does now).

Bug: 34066768
Test: make -j32 test-art-host

(cherry picked from commit 282f2b10edbd03ffd2a98910babbd2607d1c1fb1)

Change-Id: Id5b247cfa2cfb743d28cb6f4e38eb79421c56ed9
diff --git a/test/442-checker-constant-folding/build b/test/442-checker-constant-folding/build
new file mode 100644
index 0000000..1d86fa5
--- /dev/null
+++ b/test/442-checker-constant-folding/build
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+# Copyright 2017 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.
+
+./default-build "$@" --jack-option "-D jack.optimization.use-def-cst-simplifier=false"
diff --git a/test/etc/default-build b/test/etc/default-build
index e9e3886..e646aba 100755
--- a/test/etc/default-build
+++ b/test/etc/default-build
@@ -63,6 +63,7 @@
 DX_FLAGS=""
 SKIP_DX_MERGER="false"
 EXPERIMENTAL=""
+JACK_ARGS=""
 
 # The key for default arguments if no experimental things are enabled.
 DEFAULT_EXPERIMENT="no-experiment"
@@ -118,6 +119,10 @@
     DEFAULT_EXPERIMENT=""
     EXPERIMENTAL="${EXPERIMENTAL} $1"
     shift
+  elif [ "x$1" = "x--jack-option" ]; then
+    shift
+    JACK_ARGS="${JACK_ARGS} $1"
+    shift
   elif expr "x$1" : "x--" >/dev/null 2>&1; then
     echo "unknown $0 option: $1" 1>&2
     exit 1