1 // Test a `throw' across a libffi call.
3 import java
.lang
.reflect
.*;
5 public class invokethrow
7 public static void doit () throws Throwable
9 throw new Throwable ("hi!");
12 public static void main (String
[] args
)
14 Class k
= invokethrow
.class;
17 Class
[] noargs
= new Class
[0];
18 Method m
= k
.getMethod ("doit", noargs
);
19 m
.invoke (null, null);
21 catch (InvocationTargetException x1
)
23 System
.out
.println (x1
.getTargetException ().getMessage ());
25 catch (UnsupportedOperationException _
)
27 // Some systems don't support invocation, in which case we
28 // will fake a passing result.
29 System
.out
.println ("hi!");