aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/testsuite/java.lang/ExceptionTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/testsuite/java.lang/ExceptionTest.java')
-rw-r--r--libjava/classpath/testsuite/java.lang/ExceptionTest.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/libjava/classpath/testsuite/java.lang/ExceptionTest.java b/libjava/classpath/testsuite/java.lang/ExceptionTest.java
new file mode 100644
index 0000000..7a464db
--- /dev/null
+++ b/libjava/classpath/testsuite/java.lang/ExceptionTest.java
@@ -0,0 +1,21 @@
+public class ExceptionTest
+{
+ static int foo() throws ArrayIndexOutOfBoundsException {
+ int f[] = new int[10];
+
+ return f[26];
+ }
+
+ public static void main (String args[]) {
+ int f;
+
+ try {
+ f = foo();
+ }
+ catch (ArrayIndexOutOfBoundsException e) {
+ System.out.println("PASSED: " + e.toString());
+ } catch (Exception e) {
+ System.out.println("FAILED: " + e.toString());
+ }
+ }
+}