diff options
20 files changed, 51 insertions, 55 deletions
diff --git a/test/411-optimizing-arith-mul/info.txt b/test/411-optimizing-arith-mul/info.txt deleted file mode 100644 index 10155512f0..0000000000 --- a/test/411-optimizing-arith-mul/info.txt +++ /dev/null @@ -1 +0,0 @@ -Tests for basic arithmethic operations. diff --git a/test/411-optimizing-arith-mul/expected.txt b/test/411-optimizing-arith/expected.txt index e69de29bb2..e69de29bb2 100644 --- a/test/411-optimizing-arith-mul/expected.txt +++ b/test/411-optimizing-arith/expected.txt diff --git a/test/411-optimizing-arith/info.txt b/test/411-optimizing-arith/info.txt new file mode 100644 index 0000000000..42be5d564f --- /dev/null +++ b/test/411-optimizing-arith/info.txt @@ -0,0 +1,7 @@ +Tests for basic arithmethic operations: + - multiply, + - subtract, + - negate, + - division, + - modulo (rem), + - shifts. diff --git a/test/417-optimizing-arith-div/src/Main.java b/test/411-optimizing-arith/src/DivTest.java index 68e89b3eb2..7696d0a806 100644 --- a/test/417-optimizing-arith-div/src/Main.java +++ b/test/411-optimizing-arith/src/DivTest.java @@ -16,7 +16,7 @@ // Note that $opt$ is a marker for the optimizing compiler to test // it does compile the method. -public class Main { +public class DivTest { public static void expectEquals(int expected, int result) { if (expected != result) { @@ -98,11 +98,7 @@ public class Main { } } - public static void main(String[] args) { - div(); - } - - public static void div() { + public static void main() { divInt(); divLong(); divFloat(); diff --git a/test/411-optimizing-arith/src/Main.java b/test/411-optimizing-arith/src/Main.java new file mode 100644 index 0000000000..e1a43d3b57 --- /dev/null +++ b/test/411-optimizing-arith/src/Main.java @@ -0,0 +1,26 @@ +/* + * 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. + */ + +public class Main { + public static void main(String args[]) { + MulTest.main(); + SubTest.main(); + NegTest.main(); + DivTest.main(); + RemTest.main(); + ShiftsTest.main(); + } +} diff --git a/test/411-optimizing-arith-mul/src/Main.java b/test/411-optimizing-arith/src/MulTest.java index 60e418e1e5..b9bffca0d1 100644 --- a/test/411-optimizing-arith-mul/src/Main.java +++ b/test/411-optimizing-arith/src/MulTest.java @@ -16,7 +16,7 @@ // Note that $opt$ is a marker for the optimizing compiler to test // it does compile the method. -public class Main { +public class MulTest { public static void expectEquals(int expected, int result) { if (expected != result) { @@ -72,11 +72,7 @@ public class Main { } } - public static void main(String[] args) { - mul(); - } - - public static void mul() { + public static void main() { mulInt(); mulLong(); mulFloat(); @@ -129,9 +125,12 @@ public class Main { expectEquals(Float.NEGATIVE_INFINITY, $opt$Mul(-2F, 3.40282346638528860e+38F)); expectEquals(Float.NEGATIVE_INFINITY, $opt$Mul(2F, Float.NEGATIVE_INFINITY)); expectEquals(Float.POSITIVE_INFINITY, $opt$Mul(-2F, Float.NEGATIVE_INFINITY)); - expectEquals(Float.NEGATIVE_INFINITY, $opt$Mul(Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY)); - expectEquals(Float.POSITIVE_INFINITY, $opt$Mul(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY)); - expectEquals(Float.POSITIVE_INFINITY, $opt$Mul(Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY)); + expectEquals(Float.NEGATIVE_INFINITY, + $opt$Mul(Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY)); + expectEquals(Float.POSITIVE_INFINITY, + $opt$Mul(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY)); + expectEquals(Float.POSITIVE_INFINITY, + $opt$Mul(Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY)); } private static void mulDouble() { diff --git a/test/415-optimizing-arith-neg/src/Main.java b/test/411-optimizing-arith/src/NegTest.java index c53b639d40..83047269bb 100644 --- a/test/415-optimizing-arith-neg/src/Main.java +++ b/test/411-optimizing-arith/src/NegTest.java @@ -17,7 +17,7 @@ // Note that $opt$ is a marker for the optimizing compiler to test // it does compile the method, and that $noinline$ is a marker to // test that it does not inline it. -public class Main { +public class NegTest { public static void assertEquals(int expected, int result) { if (expected != result) { @@ -67,7 +67,7 @@ public class Main { } } - public static void main(String[] args) { + public static void main() { negInt(); $opt$noinline$InplaceNegOneInt(1); @@ -169,55 +169,29 @@ public class Main { } - static boolean doThrow = false; - private static void $opt$noinline$InplaceNegOneInt(int a) { - if (doThrow) { - // Try defeating inlining. - throw new Error(); - } a = -a; assertEquals(-1, a); } private static void $opt$noinline$InplaceNegOneLong(long a) { - if (doThrow) { - // Try defeating inlining. - throw new Error(); - } a = -a; assertEquals(-1L, a); } private static int $opt$noinline$NegInt(int a){ - if (doThrow) { - // Try defeating inlining. - throw new Error(); - } return -a; } private static long $opt$noinline$NegLong(long a){ - if (doThrow) { - // Try defeating inlining. - throw new Error(); - } return -a; } private static float $opt$noinline$NegFloat(float a){ - if (doThrow) { - // Try defeating inlining. - throw new Error(); - } return -a; } private static double $opt$noinline$NegDouble(double a){ - if (doThrow) { - // Try defeating inlining. - throw new Error(); - } return -a; } } diff --git a/test/428-optimizing-arith-rem/src/Main.java b/test/411-optimizing-arith/src/RemTest.java index 3f77318e6c..1b31f63569 100644 --- a/test/428-optimizing-arith-rem/src/Main.java +++ b/test/411-optimizing-arith/src/RemTest.java @@ -14,9 +14,9 @@ * limitations under the License. */ -public class Main { +public class RemTest { - public static void main(String[] args) { + public static void main() { remInt(); remLong(); } diff --git a/test/431-optimizing-arith-shifts/src/Main.java b/test/411-optimizing-arith/src/ShiftsTest.java index b7a112f6a3..139ff70bf0 100644 --- a/test/431-optimizing-arith-shifts/src/Main.java +++ b/test/411-optimizing-arith/src/ShiftsTest.java @@ -14,7 +14,7 @@ * limitations under the License. */ -public class Main { +public class ShiftsTest { public static void expectEquals(int expected, int result) { if (expected != result) { @@ -28,7 +28,7 @@ public class Main { } } - public static void main(String[] args) { + public static void main() { testShlInt(); testShlLong(); testShrInt(); diff --git a/test/414-optimizing-arith-sub/src/Main.java b/test/411-optimizing-arith/src/SubTest.java index b4531cdfd4..9c9ea92f20 100644 --- a/test/414-optimizing-arith-sub/src/Main.java +++ b/test/411-optimizing-arith/src/SubTest.java @@ -16,7 +16,7 @@ // Note that $opt$ is a marker for the optimizing compiler to test // it does compile the method. -public class Main { +public class SubTest { public static void expectEquals(int expected, int result) { if (expected != result) { @@ -70,7 +70,7 @@ public class Main { } } - public static void main(String[] args) { + public static void main() { subInt(); subLong(); subFloat(); diff --git a/test/414-optimizing-arith-sub/expected.txt b/test/414-optimizing-arith-sub/expected.txt deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/414-optimizing-arith-sub/expected.txt +++ /dev/null diff --git a/test/414-optimizing-arith-sub/info.txt b/test/414-optimizing-arith-sub/info.txt deleted file mode 100644 index 1eaa14887b..0000000000 --- a/test/414-optimizing-arith-sub/info.txt +++ /dev/null @@ -1 +0,0 @@ -Subtraction tests. diff --git a/test/415-optimizing-arith-neg/expected.txt b/test/415-optimizing-arith-neg/expected.txt deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/415-optimizing-arith-neg/expected.txt +++ /dev/null diff --git a/test/415-optimizing-arith-neg/info.txt b/test/415-optimizing-arith-neg/info.txt deleted file mode 100644 index 8494aad938..0000000000 --- a/test/415-optimizing-arith-neg/info.txt +++ /dev/null @@ -1 +0,0 @@ -Tests for arithmetic negation operations. diff --git a/test/417-optimizing-arith-div/expected.txt b/test/417-optimizing-arith-div/expected.txt deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/417-optimizing-arith-div/expected.txt +++ /dev/null diff --git a/test/417-optimizing-arith-div/info.txt b/test/417-optimizing-arith-div/info.txt deleted file mode 100644 index 1374b0ffb3..0000000000 --- a/test/417-optimizing-arith-div/info.txt +++ /dev/null @@ -1 +0,0 @@ -Tests for division operation. diff --git a/test/428-optimizing-arith-rem/expected.txt b/test/428-optimizing-arith-rem/expected.txt deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/428-optimizing-arith-rem/expected.txt +++ /dev/null diff --git a/test/428-optimizing-arith-rem/info.txt b/test/428-optimizing-arith-rem/info.txt deleted file mode 100644 index 3e37ffeee8..0000000000 --- a/test/428-optimizing-arith-rem/info.txt +++ /dev/null @@ -1 +0,0 @@ -Tests for modulo (rem) operation. diff --git a/test/431-optimizing-arith-shifts/expected.txt b/test/431-optimizing-arith-shifts/expected.txt deleted file mode 100644 index e69de29bb2..0000000000 --- a/test/431-optimizing-arith-shifts/expected.txt +++ /dev/null diff --git a/test/431-optimizing-arith-shifts/info.txt b/test/431-optimizing-arith-shifts/info.txt deleted file mode 100644 index 14ff264662..0000000000 --- a/test/431-optimizing-arith-shifts/info.txt +++ /dev/null @@ -1 +0,0 @@ -Tests for shift operations. |