Fiddle with 602-deoptimizable for adding debug info when it fails.

The host-x86-gcstress-debug fails continuously, but I cannot
reproduce this locally. Add some debug info to help.

Test: 602-deoptimizable
Change-Id: If0714afbd66d035e517427dc693d4d861ec85dde
diff --git a/test/602-deoptimizeable/check b/test/602-deoptimizeable/check
new file mode 100755
index 0000000..dceb6b5
--- /dev/null
+++ b/test/602-deoptimizeable/check
@@ -0,0 +1,17 @@
+#!/bin/bash
+#
+# Copyright (C) 2018 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.
+
+# We ignore the output. The test will exit with an error code if it fails.
diff --git a/test/602-deoptimizeable/run b/test/602-deoptimizeable/run
new file mode 100644
index 0000000..e301336
--- /dev/null
+++ b/test/602-deoptimizeable/run
@@ -0,0 +1,18 @@
+#!/bin/bash
+#
+# Copyright (C) 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.
+
+# Add some output to ease debugging.
+"${RUN}" "$@" --runtime-option -verbose:deopt --external-log-tags
diff --git a/test/602-deoptimizeable/src/Main.java b/test/602-deoptimizeable/src/Main.java
index d995923..f7ce32a 100644
--- a/test/602-deoptimizeable/src/Main.java
+++ b/test/602-deoptimizeable/src/Main.java
@@ -77,7 +77,7 @@
                 assertIsManaged();  // Only single frame is deoptimized.
                 if (res != 79) {
                     System.out.println("Failure 1!");
-                    System.exit(0);
+                    System.exit(1);
                 }
             }
         });
@@ -96,7 +96,7 @@
                     assertIsManaged();  // Only single frame is deoptimized.
                     if (res != 79.3d) {
                         System.out.println("Failure 2!");
-                        System.exit(0);
+                        System.exit(2);
                     }
                 } catch (Exception e) {
                     e.printStackTrace(System.out);
@@ -112,7 +112,7 @@
                 assertIsInterpreted();  // Every deoptimizeable method is deoptimized.
                 if (res != 0.034f) {
                     System.out.println("Failure 3!");
-                    System.exit(0);
+                    System.exit(3);
                 }
             }
         });
@@ -136,9 +136,11 @@
 
         if (!DummyObject.sHashCodeInvoked) {
             System.out.println("hashCode() method not invoked!");
+            System.exit(4);
         }
         if (map.get(new DummyObject(10)) != 100) {
             System.out.println("Wrong hashmap value!");
+            System.exit(5);
         }
         System.out.println("Finishing");
     }
@@ -163,6 +165,7 @@
         }
         if (!caught) {
             System.out.println("Expected exception");
+            System.exit(6);
         }
         assertIsInterpreted();
         return 79;
@@ -188,6 +191,7 @@
         }
         if (!caught) {
             System.out.println("Expected exception");
+            System.exit(7);
         }
         assertIsInterpreted();
         return 79.3d;