Remove obsolete `doThrow` statements from some tests.

Test: testrunner.py --host --optimizing
Change-Id: Icf8819a482f7020de65e34090fd495e62ae87c88
diff --git a/test/521-regression-integer-field-set/src/Main.java b/test/521-regression-integer-field-set/src/Main.java
index 9924e09..90890a8 100644
--- a/test/521-regression-integer-field-set/src/Main.java
+++ b/test/521-regression-integer-field-set/src/Main.java
@@ -31,24 +31,12 @@
     assertIntEquals(456789, s);
   }
 
-  private static boolean doThrow = false;
-
   private void $noinline$SetInstanceField() {
-    if (doThrow) {
-      // Try defeating inlining.
-      throw new Error();
-    }
-
     // Set a value than does not fit in a 16-bit (signed) integer.
     i = 123456;
   }
 
   private static void $noinline$SetStaticField() {
-    if (doThrow) {
-      // Try defeating inlining.
-      throw new Error();
-    }
-
     // Set a value than does not fit in a 16-bit (signed) integer.
     s = 456789;
   }
diff --git a/test/526-checker-caller-callee-regs/src/Main.java b/test/526-checker-caller-callee-regs/src/Main.java
index f402c2c..9bd08ff 100644
--- a/test/526-checker-caller-callee-regs/src/Main.java
+++ b/test/526-checker-caller-callee-regs/src/Main.java
@@ -22,12 +22,8 @@
     }
   }
 
-  static boolean doThrow = false;
-
   // This function always returns 1.
-  // We use 'throw' to prevent the function from being inlined.
   public static int $opt$noinline$function_call(int arg) {
-    if (doThrow) throw new Error();
     return 1 % arg;
   }
 
diff --git a/test/526-long-regalloc/src/Main.java b/test/526-long-regalloc/src/Main.java
index e8b3096..489db05 100644
--- a/test/526-long-regalloc/src/Main.java
+++ b/test/526-long-regalloc/src/Main.java
@@ -54,12 +54,9 @@
   }
 
   public static long $noinline$bar() {
-    if (doThrow) throw new Error();
     return 42;
   }
 
-  public static boolean doThrow = false;
-
   public static int myField1 = 0;
   public static int myField2 = 0;
   public static int myField3 = 0;
diff --git a/test/529-long-split/src/Main.java b/test/529-long-split/src/Main.java
index dc52d88..3493f77 100644
--- a/test/529-long-split/src/Main.java
+++ b/test/529-long-split/src/Main.java
@@ -167,14 +167,11 @@
   }
 
   public static void $noinline$doCall() {
-    if (doThrow) throw new Error();
   }
 
   public static void $noinline$doCall(long e) {
-    if (doThrow) throw new Error();
   }
 
-  public static boolean doThrow;
   public static int myField1;
   public static int myField2;
   public static int myField3;
diff --git a/test/530-checker-regression-reftyp-final/src/Main.java b/test/530-checker-regression-reftyp-final/src/Main.java
index f86b515..69d99e6 100644
--- a/test/530-checker-regression-reftyp-final/src/Main.java
+++ b/test/530-checker-regression-reftyp-final/src/Main.java
@@ -58,9 +58,6 @@
   }
 
   public static Object[] $noinline$getArray() {
-    if (doThrow) throw new Error();
     return new MyClassB[2];
   }
-
-  static boolean doThrow = false;
 }
diff --git a/test/534-checker-bce-deoptimization/src/Main.java b/test/534-checker-bce-deoptimization/src/Main.java
index c4e4cbf..45dcbce 100644
--- a/test/534-checker-bce-deoptimization/src/Main.java
+++ b/test/534-checker-bce-deoptimization/src/Main.java
@@ -89,7 +89,6 @@
     /// CHECK-NOT:          BoundsCheck
 
     public static void $noinline$FloatFill(float f1, float f2, float[] array, int n) {
-        if (doThrow) { throw new Error(); }
         for (int i = 0; i < n; ++i) {
             array[i] = ((i & 1) == 1) ? f1 : f2;
             f1 += 1.5f;
@@ -118,14 +117,11 @@
     /// CHECK-NOT:          BoundsCheck
 
     public static void $noinline$DoubleFill(double d1, double d2, double[] array, int n) {
-        if (doThrow) { throw new Error(); }
         for (int i = 0; i < n; ++i) {
             array[i] = ((i & 1) == 1) ? d1 : d2;
             d1 += 1.5;
             d2 += 2.25;
         }
     }
-
-    public static boolean doThrow = false;
 }
 
diff --git a/test/542-bitfield-rotates/src/Main.java b/test/542-bitfield-rotates/src/Main.java
index f2bc153..4308439 100644
--- a/test/542-bitfield-rotates/src/Main.java
+++ b/test/542-bitfield-rotates/src/Main.java
@@ -48,12 +48,7 @@
     test_Long_left_constant_v();
   }
 
-  public static boolean doThrow = false;
-
   public static int $noinline$rotate_int_right_reg_v_csubv(int value, int distance) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> distance) | (value << (32 - distance));
   }
 
@@ -74,9 +69,6 @@
   }
 
   public static long $noinline$rotate_long_right_reg_v_csubv(long value, int distance) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> distance) | (value << (64 - distance));
   }
 
@@ -97,9 +89,6 @@
   }
 
   public static int $noinline$rotate_int_left_reg_csubv_v(int value, int distance) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> (32 - distance)) | (value << distance);
   }
 
@@ -120,9 +109,6 @@
   }
 
   public static long $noinline$rotate_long_left_reg_csubv_v(long value, int distance) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> (64 - distance)) | (value << distance);
   }
 
@@ -143,9 +129,6 @@
   }
 
   public static int $noinline$rotate_int_right_reg_v_negv(int value, int distance) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> distance) | (value << -distance);
   }
 
@@ -166,9 +149,6 @@
   }
 
   public static long $noinline$rotate_long_right_reg_v_negv(long value, int distance) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> distance) | (value << -distance);
   }
 
@@ -189,9 +169,6 @@
   }
 
   public static int $noinline$rotate_int_left_reg_negv_v(int value, int distance) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> -distance) | (value << distance);
   }
 
@@ -212,9 +189,6 @@
   }
 
   public static long $noinline$rotate_long_left_reg_negv_v(long value, int distance) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> -distance) | (value << distance);
   }
 
@@ -235,30 +209,18 @@
   }
 
   public static int $noinline$rotate_int_right_constant_0(int value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> 0) | (value << 0);
   }
 
   public static int $noinline$rotate_int_right_constant_1(int value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> 1) | (value << -1);
   }
 
   public static int $noinline$rotate_int_right_constant_m1(int value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> -1) | (value << 1);
   }
 
   public static int $noinline$rotate_int_right_constant_16(int value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> 16) | (value << -16);
   }
 
@@ -270,51 +232,30 @@
   }
 
   public static long $noinline$rotate_long_right_constant_0(long value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> 0) | (value << 0);
   }
 
   public static long $noinline$rotate_long_right_constant_1(long value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> 1) | (value << -1);
   }
 
   public static long $noinline$rotate_long_right_constant_m1(long value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> -1) | (value << 1);
   }
 
   public static long $noinline$rotate_long_right_constant_16(long value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> 16) | (value << -16);
   }
 
   public static long $noinline$rotate_long_right_constant_32(long value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> 32) | (value << -32);
   }
 
   public static long $noinline$rotate_long_right_constant_48(long value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> 48) | (value << -48);
   }
 
   public static long $noinline$rotate_long_right_constant_64(long value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value >>> 64) | (value << -64);
   }
 
@@ -328,30 +269,18 @@
   }
 
   public static int $noinline$rotate_int_left_constant_0(int value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value << 0) | (value >>> 0);
   }
 
   public static int $noinline$rotate_int_left_constant_1(int value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value << 1) | (value >>> -1);
   }
 
   public static int $noinline$rotate_int_left_constant_m1(int value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value << -1) | (value >>> 1);
   }
 
   public static int $noinline$rotate_int_left_constant_16(int value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value << 16) | (value >>> -16);
   }
 
@@ -363,51 +292,30 @@
   }
 
   public static long $noinline$rotate_long_left_constant_0(long value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value << 0) | (value >>> 0);
   }
 
   public static long $noinline$rotate_long_left_constant_1(long value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value << 1) | (value >>> -1);
   }
 
   public static long $noinline$rotate_long_left_constant_m1(long value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value << -1) | (value >>> 1);
   }
 
   public static long $noinline$rotate_long_left_constant_16(long value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value << 16) | (value >>> -16);
   }
 
   public static long $noinline$rotate_long_left_constant_32(long value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value << 32) | (value >>> -32);
   }
 
   public static long $noinline$rotate_long_left_constant_48(long value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value << 48) | (value >>> -48);
   }
 
   public static long $noinline$rotate_long_left_constant_64(long value) {
-    if (doThrow) {
-      throw new Error();
-    }
     return (value << 64) | (value >>> -64);
   }
 
diff --git a/test/552-checker-sharpening/src/Main.java b/test/552-checker-sharpening/src/Main.java
index 15ff8a6..b017ab0 100644
--- a/test/552-checker-sharpening/src/Main.java
+++ b/test/552-checker-sharpening/src/Main.java
@@ -34,10 +34,7 @@
     }
   }
 
-  public static boolean doThrow = false;
-
   private static int $noinline$foo(int x) {
-    if (doThrow) { throw new Error(); }
     return x;
   }
 
@@ -135,8 +132,6 @@
   /// CHECK:                LoadString load_kind:BootImageRelRo
 
   public static String $noinline$getBootImageString() {
-    // Prevent inlining to avoid the string comparison being optimized away.
-    if (doThrow) { throw new Error(); }
     // Empty string is known to be in the boot image.
     return "";
   }
@@ -152,8 +147,6 @@
   /// CHECK-DAG:            LoadString load_kind:BssEntry
 
   public static String $noinline$getNonBootImageString() {
-    // Prevent inlining to avoid the string comparison being optimized away.
-    if (doThrow) { throw new Error(); }
     // This string is not in the boot image.
     return "non-boot-image-string";
   }
@@ -162,8 +155,6 @@
   /// CHECK:                LoadClass load_kind:BootImageRelRo class_name:java.lang.String
 
   public static Class<?> $noinline$getStringClass() {
-    // Prevent inlining to avoid the string comparison being optimized away.
-    if (doThrow) { throw new Error(); }
     // String class is known to be in the boot image.
     return String.class;
   }
@@ -179,8 +170,6 @@
   /// CHECK-DAG:            LoadClass load_kind:BssEntry class_name:Other
 
   public static Class<?> $noinline$getOtherClass() {
-    // Prevent inlining to avoid the string comparison being optimized away.
-    if (doThrow) { throw new Error(); }
     // Other class is not in the boot image.
     return Other.class;
   }
diff --git a/test/553-invoke-super/src/SuperClass.java b/test/553-invoke-super/src/SuperClass.java
index 36ce093..c3e4a4e 100644
--- a/test/553-invoke-super/src/SuperClass.java
+++ b/test/553-invoke-super/src/SuperClass.java
@@ -15,12 +15,7 @@
  */
 
 public class SuperClass {
-  boolean doThrow = false;
-
   public int $noinline$returnInt() {
-    if (doThrow) {
-      throw new Error();
-    }
     return 42;
   }
 }
diff --git a/test/561-divrem/src/Main.java b/test/561-divrem/src/Main.java
index 082783d..ec125e9 100644
--- a/test/561-divrem/src/Main.java
+++ b/test/561-divrem/src/Main.java
@@ -72,32 +72,18 @@
   }
 
   public static int $noinline$divInt(int value) {
-    if (doThrow) {
-      throw new Error("");
-    }
     return value / Integer.MIN_VALUE;
   }
 
   public static int $noinline$remInt(int value) {
-    if (doThrow) {
-      throw new Error("");
-    }
     return value % Integer.MIN_VALUE;
   }
 
   public static long $noinline$divLong(long value) {
-    if (doThrow) {
-      throw new Error("");
-    }
     return value / Long.MIN_VALUE;
   }
 
   public static long $noinline$remLong(long value) {
-    if (doThrow) {
-      throw new Error("");
-    }
     return value % Long.MIN_VALUE;
   }
-
-  static boolean doThrow = false;
 }
diff --git a/test/563-checker-fakestring/src/Main.java b/test/563-checker-fakestring/src/Main.java
index d45e803..e2773c8 100644
--- a/test/563-checker-fakestring/src/Main.java
+++ b/test/563-checker-fakestring/src/Main.java
@@ -165,10 +165,7 @@
     }
   }
 
-  public static boolean doThrow = false;
-
   public static Object $noinline$HiddenNull() {
-    if (doThrow) { throw new Error(); }
     return null;
   }
 }
diff --git a/test/564-checker-bitcount/src/Main.java b/test/564-checker-bitcount/src/Main.java
index e022d9d..460a31a 100644
--- a/test/564-checker-bitcount/src/Main.java
+++ b/test/564-checker-bitcount/src/Main.java
@@ -25,7 +25,6 @@
   /// CHECK-DAG:     <<Result:i\d+>>  InvokeStaticOrDirect intrinsic:IntegerBitCount
   /// CHECK-DAG:                      Return [<<Result>>]
   private static int $noinline$BitCountBoolean(boolean x) {
-    if (doThrow) { throw new Error(); }  // Try defeating inlining.
     return Integer.bitCount(x ? 1 : 0);
   }
 
@@ -33,7 +32,6 @@
   /// CHECK-DAG:     <<Result:i\d+>>  InvokeStaticOrDirect intrinsic:IntegerBitCount
   /// CHECK-DAG:                      Return [<<Result>>]
   private static int $noinline$BitCountByte(byte x) {
-    if (doThrow) { throw new Error(); }  // Try defeating inlining.
     return Integer.bitCount(x);
   }
 
@@ -41,7 +39,6 @@
   /// CHECK-DAG:     <<Result:i\d+>>  InvokeStaticOrDirect intrinsic:IntegerBitCount
   /// CHECK-DAG:                      Return [<<Result>>]
   private static int $noinline$BitCountShort(short x) {
-    if (doThrow) { throw new Error(); }  // Try defeating inlining.
     return Integer.bitCount(x);
   }
 
@@ -49,7 +46,6 @@
   /// CHECK-DAG:     <<Result:i\d+>>  InvokeStaticOrDirect intrinsic:IntegerBitCount
   /// CHECK-DAG:                      Return [<<Result>>]
   private static int $noinline$BitCountChar(char x) {
-    if (doThrow) { throw new Error(); }  // Try defeating inlining.
     return Integer.bitCount(x);
   }
 
@@ -57,7 +53,6 @@
   /// CHECK-DAG:     <<Result:i\d+>>  InvokeStaticOrDirect intrinsic:IntegerBitCount
   /// CHECK-DAG:                      Return [<<Result>>]
   private static int $noinline$BitCountInt(int x) {
-    if (doThrow) { throw new Error(); }  // Try defeating inlining.
     return Integer.bitCount(x);
   }
 
@@ -65,7 +60,6 @@
   /// CHECK-DAG:     <<Result:i\d+>>  InvokeStaticOrDirect intrinsic:LongBitCount
   /// CHECK-DAG:                      Return [<<Result>>]
   private static int $noinline$BitCountLong(long x) {
-    if (doThrow) { throw new Error(); }  // Try defeating inlining.
     return Long.bitCount(x);
   }
 
@@ -201,6 +195,4 @@
       throw new Error("Expected: " + expected + ", found: " + result);
     }
   }
-
-  private static boolean doThrow = false;
 }
diff --git a/test/566-checker-codegen-select/src/Main.java b/test/566-checker-codegen-select/src/Main.java
index e215ab0..7b44580 100644
--- a/test/566-checker-codegen-select/src/Main.java
+++ b/test/566-checker-codegen-select/src/Main.java
@@ -21,7 +21,6 @@
   /// CHECK-NEXT:                  Select [{{j\d+}},{{j\d+}},<<Cond>>]
 
   public long $noinline$longSelect(long param) {
-    if (doThrow) { throw new Error(); }
     long val_true = longB;
     long val_false = longC;
     return (param > longA) ? val_true : val_false;
@@ -46,7 +45,6 @@
   /// CHECK:             cmovle/ngq
 
   public long $noinline$longSelect_Constant(long param) {
-    if (doThrow) { throw new Error(); }
     long val_true = longB;
     long val_false = longC;
     return (param > 3L) ? val_true : val_false;
@@ -60,7 +58,6 @@
   /// CHECK:             cmovl/nge
 
   public int $noinline$intSelect_Constant(int param) {
-    if (doThrow) { throw new Error(); }
     int val_true = intB;
     int val_false = intC;
     return (param >= 3) ? val_true : val_false;
@@ -88,8 +85,6 @@
     }
   }
 
-  public boolean doThrow = false;
-
   public long longA = 3L;
   public long longB = 5L;
   public long longC = 7L;
diff --git a/test/566-polymorphic-inlining/src/Main.java b/test/566-polymorphic-inlining/src/Main.java
index 595a056..691d48f 100644
--- a/test/566-polymorphic-inlining/src/Main.java
+++ b/test/566-polymorphic-inlining/src/Main.java
@@ -118,7 +118,6 @@
   }
 
   public static void $noinline$testInlineToSameTarget(Main m) {
-    if (doThrow) throw new Error("");
     m.increment();
   }
 
@@ -137,7 +136,6 @@
     counter++;
   }
   public static int counter = 0;
-  public static boolean doThrow = false;
 }
 
 class Subclass extends Main {
diff --git a/test/567-checker-builder-intrinsics/src/TestFpAbs.java b/test/567-checker-builder-intrinsics/src/TestFpAbs.java
index e6c338d..f36432d 100644
--- a/test/567-checker-builder-intrinsics/src/TestFpAbs.java
+++ b/test/567-checker-builder-intrinsics/src/TestFpAbs.java
@@ -29,8 +29,6 @@
   private static final int SPQUIET = 1 << 22;
   private static final long DPQUIET = 1L << 51;
 
-  public static boolean doThrow = false;
-
   /// CHECK-START: float TestFpAbs.$opt$noinline$absSP(float) builder (after)
   /// CHECK-DAG: <<Result:f\d+>> Abs
   /// CHECK-DAG:                 Return [<<Result>>]
diff --git a/test/578-polymorphic-inlining/src/Main.java b/test/578-polymorphic-inlining/src/Main.java
index 22d33d0..4798922 100644
--- a/test/578-polymorphic-inlining/src/Main.java
+++ b/test/578-polymorphic-inlining/src/Main.java
@@ -44,10 +44,7 @@
   }
 
   public static void $noinline$foo() {
-    if (doThrow) throw new Error("");
   }
-
-  public static boolean doThrow;
 }
 
 class SubMain extends Main {
diff --git a/test/593-checker-long-2-float-regression/src/Main.java b/test/593-checker-long-2-float-regression/src/Main.java
index b31cbde..d55d0fd 100644
--- a/test/593-checker-long-2-float-regression/src/Main.java
+++ b/test/593-checker-long-2-float-regression/src/Main.java
@@ -16,7 +16,6 @@
 
 public class Main {
 
-  static boolean doThrow = false;
   static long longValue;
 
   public static void assertEquals(float expected, float result) {
@@ -35,10 +34,9 @@
   /// CHECK-DAG:                       Return [<<Convert>>]
 
   static float $noinline$longToFloat() {
-    if (doThrow) { throw new Error(); }
     longValue = $inline$returnConst();
     // This call prevents D8 from replacing the result of the sget instruction
-    // in line 43 by the result of the call to $inline$returnConst() in line 39.
+    // in line 41 by the result of the call to $inline$returnConst() in line 39.
     $inline$preventRedundantFieldLoadEliminationInD8();
     return (float) longValue;
   }
diff --git a/test/594-load-string-regression/src/Main.java b/test/594-load-string-regression/src/Main.java
index 0b9f7b5..5903130 100644
--- a/test/594-load-string-regression/src/Main.java
+++ b/test/594-load-string-regression/src/Main.java
@@ -15,8 +15,6 @@
  */
 
 public class Main {
-  static boolean doThrow = false;
-
   // Note: We're not doing checker tests as we cannot do them specifically for a non-PIC
   // configuration. The check here would be "prepare_for_register_allocation (before)"
   //     CHECK:         LoadClass
@@ -28,8 +26,6 @@
   //     CHECK-NEXT:    NewInstance
   // but the order of instructions for non-PIC mode is different.
   public static int $noinline$test() {
-    if (doThrow) { throw new Error(); }
-
     int r = 0x12345678;
     do {
       // LICM pulls the LoadClass and ClinitCheck out of the loop, leaves NewInstance in the loop.
@@ -67,11 +63,7 @@
 }
 
 class Helper {
-  static boolean doThrow = false;
-
   public void $noinline$printString(String s) {
-    if (doThrow) { throw new Error(); }
-
     System.out.println("String: \"" + s + "\"");
   }
 }