Merge basic arithmetic tests.
And remove obsolete "doThrow" statements.
Test: testrunner.py --host -t 411-optimizing-arith
Change-Id: Ie44374c3ed007c7ffd0462ae4e8eef767bb28863
diff --git a/test/411-optimizing-arith-mul/info.txt b/test/411-optimizing-arith-mul/info.txt
deleted file mode 100644
index 1015551..0000000
--- 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
similarity index 100%
rename from test/411-optimizing-arith-mul/expected.txt
rename to 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 0000000..42be5d5
--- /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
similarity index 98%
rename from test/417-optimizing-arith-div/src/Main.java
rename to test/411-optimizing-arith/src/DivTest.java
index 68e89b3..7696d0a 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 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 0000000..e1a43d3
--- /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
similarity index 93%
rename from test/411-optimizing-arith-mul/src/Main.java
rename to test/411-optimizing-arith/src/MulTest.java
index 60e418e..b9bffca 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 static void main(String[] args) {
- mul();
- }
-
- public static void mul() {
+ public static void main() {
mulInt();
mulLong();
mulFloat();
@@ -129,9 +125,12 @@
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
similarity index 92%
rename from test/415-optimizing-arith-neg/src/Main.java
rename to test/411-optimizing-arith/src/NegTest.java
index c53b639..8304726 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 static void main(String[] args) {
+ public static void main() {
negInt();
$opt$noinline$InplaceNegOneInt(1);
@@ -169,55 +169,29 @@
}
- 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
similarity index 98%
rename from test/428-optimizing-arith-rem/src/Main.java
rename to test/411-optimizing-arith/src/RemTest.java
index 3f77318..1b31f63 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
similarity index 98%
rename from test/431-optimizing-arith-shifts/src/Main.java
rename to test/411-optimizing-arith/src/ShiftsTest.java
index b7a112f..139ff70 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 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
similarity index 98%
rename from test/414-optimizing-arith-sub/src/Main.java
rename to test/411-optimizing-arith/src/SubTest.java
index b4531cd..9c9ea92 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 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 e69de29..0000000
--- 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 1eaa148..0000000
--- 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 e69de29..0000000
--- 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 8494aad..0000000
--- 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 e69de29..0000000
--- 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 1374b0f..0000000
--- 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 e69de29..0000000
--- 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 3e37ffe..0000000
--- 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 e69de29..0000000
--- 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 14ff264..0000000
--- a/test/431-optimizing-arith-shifts/info.txt
+++ /dev/null
@@ -1 +0,0 @@
-Tests for shift operations.