mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-19 11:49:40 +08:00
30 lines
551 B
Java
30 lines
551 B
Java
|
// Test a `throw' across a libffi call.
|
||
|
|
||
|
import java.lang.reflect.*;
|
||
|
|
||
|
public class invokethrow
|
||
|
{
|
||
|
public static void doit () throws Throwable
|
||
|
{
|
||
|
throw new Throwable ("hi!");
|
||
|
}
|
||
|
|
||
|
public static void main (String[] args)
|
||
|
{
|
||
|
Class k = invokethrow.class;
|
||
|
try
|
||
|
{
|
||
|
Class[] noargs = new Class[0];
|
||
|
Method m = k.getMethod ("doit", noargs);
|
||
|
m.invoke (null, null);
|
||
|
}
|
||
|
catch (InvocationTargetException x1)
|
||
|
{
|
||
|
System.out.println (x1.getTargetException ().getMessage ());
|
||
|
}
|
||
|
catch (Throwable _)
|
||
|
{
|
||
|
}
|
||
|
}
|
||
|
}
|