Exception support for CanPutArrayElementFromCode.
Also a unit test.
Change-Id: I6fb4b4180d36ea2d8447a9b4d5cf28cf410960cd
diff --git a/test/IntMath/IntMath.java b/test/IntMath/IntMath.java
index e5fa806..b1b7312 100644
--- a/test/IntMath/IntMath.java
+++ b/test/IntMath/IntMath.java
@@ -786,6 +786,34 @@
return res;
}
+ static void throwArrayStoreException(Object[] array, Object element) {
+ array[0] = element;
+ }
+
+ static int testArrayStoreException() {
+ int res=0;
+ Object[] array = new Number[2];
+ try {
+ throwArrayStoreException(array, null);
+ res += 1;
+ } catch(ArrayStoreException e) {
+ res += 2;
+ }
+ try {
+ throwArrayStoreException(array, Integer.valueOf(1));
+ res += 10;
+ } catch(ArrayStoreException e) {
+ res += 20;
+ }
+ try {
+ throwArrayStoreException(array, "hello MTV-44");
+ res += 100;
+ } catch(ArrayStoreException e) {
+ res += 200;
+ }
+ return res;
+ }
+
static long recursion_count_;
static void throwStackOverflow(long l) {
recursion_count_++;
@@ -966,6 +994,14 @@
failure = true;
}
+ res = testArrayStoreException();
+ if (res == 211) {
+ System.out.println("testArrayStore PASSED");
+ } else {
+ System.out.println("testArrayStore FAILED: " + res);
+ failure = true;
+ }
+
lres= testStackOverflow();
if (lres == 0) {
System.out.println("testStackOverflow PASSED");