runtime: Add -Xverify:softfail and ART_TEST_INTERPRETER_ACCESS_CHECKS

Use ART_TEST_INTERPRETER_ACCESS_CHECKS=true to run all the tests through
the interpreter with access checks enabled. The normal interpreter tests
do not currently enable access checks, which means that a large part of
the interpreter codebase is untested.

The verifier will force every class into a soft fail mode if
-Xverify:softfail is used, thereby ensuring that if used along with the
interpreter (-Xint) that the interpret is always in access checks mode.

This is used alongside with --compile-filter=verify-at-runtime to
prevent the AOT compiler from putting down any code.

Change-Id: I35a10ed8c43d76fa96133cf01fdad497da387200
diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar
index 842d87e..db64b77 100755
--- a/test/etc/run-test-jar
+++ b/test/etc/run-test-jar
@@ -42,7 +42,7 @@
 TIME_OUT_VALUE=10
 USE_GDB="n"
 USE_JVM="n"
-VERIFY="y"
+VERIFY="y" # y=yes,n=no,s=softfail
 ZYGOTE=""
 DEX_VERIFY=""
 USE_DEX2OAT_AND_PATCHOAT="y"
@@ -149,6 +149,9 @@
     elif [ "x$1" = "x--no-verify" ]; then
         VERIFY="n"
         shift
+    elif [ "x$1" = "x--verify-soft-fail" ]; then
+        VERIFY="s"
+        shift
     elif [ "x$1" = "x--no-optimize" ]; then
         OPTIMIZE="n"
         shift
@@ -201,7 +204,11 @@
     if [ "$VERIFY" = "y" ]; then
         JVM_VERIFY_ARG="-Xverify:all"
         msg "Performing verification"
-    else
+    elif [ "$VERIFY" = "s" ]; then
+        JVM_VERIFY_ARG="Xverify:all"
+        DEX_VERIFY="-Xverify:softfail"
+        msg "Forcing verification to be soft fail"
+    else # VERIFY = "n"
         DEX_VERIFY="-Xverify:none"
         JVM_VERIFY_ARG="-Xverify:none"
         msg "Skipping verification"
@@ -263,7 +270,10 @@
     INT_OPTS="-Xint"
     if [ "$VERIFY" = "y" ] ; then
       COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=interpret-only"
-    else
+    elif [ "$VERIFY" = "s" ]; then
+      COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=verify-at-runtime"
+      DEX_VERIFY="${DEX_VERIFY} -Xverify:softfail"
+    else # VERIFY = "n"
       COMPILE_FLAGS="${COMPILE_FLAGS} --compiler-filter=verify-none"
       DEX_VERIFY="${DEX_VERIFY} -Xverify:none"
     fi