This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: new test case


I'm checking this in.

This is a test case for an error condition in class initialization.
Currently we fail this test.  I have a fix which I'll check in
shortly.

Note that even with my patch we still fail when optimizing.  I believe
we inline in a situation where we shouldn't.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* libjava.lang/initexc.java: New file.
	* libjava.lang/initexc.out: New file.

Index: libjava.lang/initexc.java
===================================================================
RCS file: libjava.lang/initexc.java
diff -N libjava.lang/initexc.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ libjava.lang/initexc.java 2 Nov 2002 23:34:33 -0000
@@ -0,0 +1,35 @@
+public class initexc
+{
+  public static class fail
+  {
+    static
+    {
+      throw new NullPointerException("nope");
+    }
+
+    public static int val ()
+    {
+      return 23;
+    }
+  }
+
+  public static void main (String[] args)
+  {
+    try
+      {
+	System.out.println (fail.val ());
+      }
+    catch (ExceptionInInitializerError _)
+      {
+	// Ok.
+      }
+    try
+      {
+	System.out.println (fail.val ());
+      }
+    catch (NoClassDefFoundError _)
+      {
+	// Ok.
+      }
+  }
+}
Index: libjava.lang/initexc.out
===================================================================
RCS file: libjava.lang/initexc.out
diff -N libjava.lang/initexc.out


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]