diff options
author | 2022-10-05 10:42:18 +0000 | |
---|---|---|
committer | 2022-10-05 12:45:08 +0000 | |
commit | 62ed9bb28ecf67f45bdc8cd0a7a262cb0bcbab80 (patch) | |
tree | 9464a6b290f0c15cedaf75812a14ad53c745fca4 | |
parent | d08df3441777d9c20455ee4cd26279384d95f9b1 (diff) |
Remove obsolete `doThrow` statements from some tests.
Test: testrunner.py --host --optimizing
Change-Id: Icf8819a482f7020de65e34090fd495e62ae87c88
18 files changed, 1 insertions, 185 deletions
diff --git a/test/521-regression-integer-field-set/src/Main.java b/test/521-regression-integer-field-set/src/Main.java index 9924e09f0f..90890a8b6b 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 @@ class Main { 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 f402c2cd48..9bd08ff0f5 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 @@ public class Main { } } - 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 e8b3096d06..489db050be 100644 --- a/test/526-long-regalloc/src/Main.java +++ b/test/526-long-regalloc/src/Main.java @@ -54,12 +54,9 @@ class Main { } 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 dc52d88486..3493f77e75 100644 --- a/test/529-long-split/src/Main.java +++ b/test/529-long-split/src/Main.java @@ -167,14 +167,11 @@ public class Main { } 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 f86b515cae..69d99e6fe4 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 class Main { } 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 c4e4cbf0b5..45dcbce65d 100644 --- a/test/534-checker-bce-deoptimization/src/Main.java +++ b/test/534-checker-bce-deoptimization/src/Main.java @@ -89,7 +89,6 @@ public class Main { /// 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 @@ public class Main { /// 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 f2bc1531dc..4308439ac7 100644 --- a/test/542-bitfield-rotates/src/Main.java +++ b/test/542-bitfield-rotates/src/Main.java @@ -48,12 +48,7 @@ public class Main { 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 class Main { } 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 class Main { } 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 class Main { } 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 class Main { } 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 class Main { } 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 class Main { } 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 class Main { } 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 class Main { } 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 class Main { } 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 class Main { } 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 class Main { } 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 15ff8a64f2..b017ab024b 100644 --- a/test/552-checker-sharpening/src/Main.java +++ b/test/552-checker-sharpening/src/Main.java @@ -34,10 +34,7 @@ public class Main { } } - public static boolean doThrow = false; - private static int $noinline$foo(int x) { - if (doThrow) { throw new Error(); } return x; } @@ -135,8 +132,6 @@ public class Main { /// 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 @@ public class Main { /// 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 @@ public class Main { /// 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 @@ public class Main { /// 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 36ce0933f0..c3e4a4e859 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 082783df2d..ec125e920d 100644 --- a/test/561-divrem/src/Main.java +++ b/test/561-divrem/src/Main.java @@ -72,32 +72,18 @@ public class Main { } 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 d45e803c22..e2773c8546 100644 --- a/test/563-checker-fakestring/src/Main.java +++ b/test/563-checker-fakestring/src/Main.java @@ -165,10 +165,7 @@ public class Main { } } - 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 e022d9dd5c..460a31a740 100644 --- a/test/564-checker-bitcount/src/Main.java +++ b/test/564-checker-bitcount/src/Main.java @@ -25,7 +25,6 @@ public class Main { /// 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 @@ public class Main { /// 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 @@ public class Main { /// 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 @@ public class Main { /// 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 @@ public class Main { /// 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 @@ public class Main { /// 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 @@ public class Main { 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 e215ab0309..7b445801eb 100644 --- a/test/566-checker-codegen-select/src/Main.java +++ b/test/566-checker-codegen-select/src/Main.java @@ -21,7 +21,6 @@ public class Main { /// 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 @@ public class Main { /// 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 @@ public class Main { /// 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 class Main { } } - 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 595a0567c1..691d48f13c 100644 --- a/test/566-polymorphic-inlining/src/Main.java +++ b/test/566-polymorphic-inlining/src/Main.java @@ -118,7 +118,6 @@ public class Main implements Itf { } public static void $noinline$testInlineToSameTarget(Main m) { - if (doThrow) throw new Error(""); m.increment(); } @@ -137,7 +136,6 @@ public class Main implements Itf { 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 e6c338d3e7..f36432d16f 100644 --- a/test/567-checker-builder-intrinsics/src/TestFpAbs.java +++ b/test/567-checker-builder-intrinsics/src/TestFpAbs.java @@ -29,8 +29,6 @@ public class TestFpAbs { 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 22d33d083b..4798922f52 100644 --- a/test/578-polymorphic-inlining/src/Main.java +++ b/test/578-polymorphic-inlining/src/Main.java @@ -44,10 +44,7 @@ public class Main { } 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 b31cbdef67..d55d0fd630 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 @@ public class Main { /// 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 0b9f7b52a1..59031304f2 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 @@ public class Main { // 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 @@ public class Main { } class Helper { - static boolean doThrow = false; - public void $noinline$printString(String s) { - if (doThrow) { throw new Error(); } - System.out.println("String: \"" + s + "\""); } } |