summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/106-exceptions2/expected.txt4
-rw-r--r--test/106-exceptions2/info.txt1
-rw-r--r--test/106-exceptions2/src/Main.java (renamed from test/ExceptionTest/ExceptionTest.java)42
3 files changed, 26 insertions, 21 deletions
diff --git a/test/106-exceptions2/expected.txt b/test/106-exceptions2/expected.txt
new file mode 100644
index 0000000..50472f7
--- /dev/null
+++ b/test/106-exceptions2/expected.txt
@@ -0,0 +1,4 @@
+nullCheckTestNoThrow PASSED
+nullCheckTestThrow PASSED
+checkAIOBE PASSED
+checkDivZero PASSED
diff --git a/test/106-exceptions2/info.txt b/test/106-exceptions2/info.txt
new file mode 100644
index 0000000..88b603f
--- /dev/null
+++ b/test/106-exceptions2/info.txt
@@ -0,0 +1 @@
+Test runtime exceptions for potential regressions caused by the compiler.
diff --git a/test/ExceptionTest/ExceptionTest.java b/test/106-exceptions2/src/Main.java
index 3edae6d..7d5a64a 100644
--- a/test/ExceptionTest/ExceptionTest.java
+++ b/test/106-exceptions2/src/Main.java
@@ -14,14 +14,14 @@
* limitations under the License.
*/
-class ExceptionTest {
+class Main {
public int ifoo;
/* Test requires visual inspection of object code to verify */
- int noThrow(ExceptionTest nonNullA,
- ExceptionTest nonNullB,
- ExceptionTest nonNullC) {
+ int noThrow(Main nonNullA,
+ Main nonNullB,
+ Main nonNullC) {
// "this" check should be eliminated on both IGET/IPUT
ifoo++;
@@ -53,12 +53,12 @@ class ExceptionTest {
}
/* Test to ensure we don't remove necessary null checks */
- int checkThrow(ExceptionTest nonNullA,
- ExceptionTest nonNullB,
- ExceptionTest nonNullC,
- ExceptionTest nullA,
- ExceptionTest nullB,
- ExceptionTest nullC) {
+ int checkThrow(Main nonNullA,
+ Main nonNullB,
+ Main nonNullC,
+ Main nullA,
+ Main nullB,
+ Main nullC) {
// "this" check should be eliminated on both IGET/IPUT
ifoo++;
@@ -131,22 +131,22 @@ class ExceptionTest {
static int nullCheckTestNoThrow(int x) {
- ExceptionTest base = new ExceptionTest();
- ExceptionTest a = new ExceptionTest();
- ExceptionTest b = new ExceptionTest();
- ExceptionTest c = new ExceptionTest();
+ Main base = new Main();
+ Main a = new Main();
+ Main b = new Main();
+ Main c = new Main();
base.ifoo = x;
return base.noThrow(a,b,c);
}
static int nullCheckTestThrow(int x) {
- ExceptionTest base = new ExceptionTest();
- ExceptionTest a = new ExceptionTest();
- ExceptionTest b = new ExceptionTest();
- ExceptionTest c = new ExceptionTest();
- ExceptionTest d = null;
- ExceptionTest e = null;
- ExceptionTest f = null;
+ Main base = new Main();
+ Main a = new Main();
+ Main b = new Main();
+ Main c = new Main();
+ Main d = null;
+ Main e = null;
+ Main f = null;
base.ifoo = x;
return base.checkThrow(a,b,c,d,e,f);
}