* libjava.lang/instinit2.java: New file.
* libjava.lang/instinit.out: New file.
* libjava.lang/instinit.java: New file.
* libjava.lang/anonarray2.out: New file.
* libjava.lang/anonarray2.java: New file.
* libjava.lang/anonarray.out: New file.
* libjava.lang/anonarray.java: New file.
* libjava.lang/nested_with_ctor.out: New file.
* libjava.lang/nested_with_ctor.java: New file.
* libjava.lang/anfi.out: New file.
* libjava.lang/anfi.java: New file.
* libjava.lang/stub.out: New file.
* libjava.lang/stub.java: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31841
138bc75d-0d04-0410-961f-
82ee72b054a4
+2000-02-07 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * libjava.lang/instinit2.out: New file.
+ * libjava.lang/instinit2.java: New file.
+ * libjava.lang/instinit.out: New file.
+ * libjava.lang/instinit.java: New file.
+ * libjava.lang/anonarray2.out: New file.
+ * libjava.lang/anonarray2.java: New file.
+ * libjava.lang/anonarray.out: New file.
+ * libjava.lang/anonarray.java: New file.
+ * libjava.lang/nested_with_ctor.out: New file.
+ * libjava.lang/nested_with_ctor.java: New file.
+ * libjava.lang/anfi.out: New file.
+ * libjava.lang/anfi.java: New file.
+ * libjava.lang/stub.out: New file.
+ * libjava.lang/stub.java: New file.
+
2000-01-30 Alexandre Petit-Bianco <apbianco@cygnus.com>
* libjava.lang/final_inner.java: New file.
--- /dev/null
+// Class anfi
+// Generated on Sat Jan 29 16:06:33 PST 2000
+// Anonymous with access to outer context locals
+
+class anfi {
+
+ itf foo (final String s, final int i) {
+ return new itf () {
+ String buff = s+" "+i;
+ public void setString (String s) { buff = s+" "+i; }
+ public String getString () { return buff; }
+ };
+ }
+
+ void test () {
+ itf x = foo ("Hello", 123);
+ System.out.println (x.getString ());
+ x.setString ("Frinkahedron");
+ System.out.println (x.getString ());
+ }
+
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `anfi'...");
+ new anfi().test();
+ }
+}
+
+interface itf {
+ void setString (String s);
+ String getString();
+ String buff = null;
+}
--- /dev/null
+Testing class `anfi'...
+Hello 123
+Frinkahedron 123
--- /dev/null
+// Class anonarray
+// Generated on Tue Feb 1 16:11:29 PST 2000
+// Simple anonymous array, of primitive types.
+
+class anonarray {
+
+ static void foo (int [][] x) {
+ for (int i = 0; i < x.length; i++)
+ {
+ for (int j = 0; j < x[i].length; j++)
+ System.out.print (x[i][j]);
+ System.out.println();
+ }
+ }
+
+ public static void main (String[] arg)
+ {
+ foo (new int[][] {{2,3},{5,7}});
+ System.out.println ((new int [][] {{11,13},{17,19}}).length);
+ System.out.println ((new int [][] {{23,29},{31,37}})[0][1]);
+ }
+}
--- /dev/null
+23
+57
+2
+29
--- /dev/null
+// Class anonarray2
+// Generated on Tue Feb 1 21:14:06 PST 2000
+// Anonymous array, with a non primitive type.
+
+class anonarray2 {
+
+ static void foo (String [][] x) {
+ for (int i = 0; i < x.length; i++)
+ {
+ for (int j = 0; j < x[i].length; j++)
+ System.out.print (x[i][j]);
+ System.out.println();
+ }
+ }
+
+ public static void main (String[] arg)
+ {
+ foo (new String[][] {{"2","3"},{"5","7"}});
+ System.out.println ((new String [][] {{"11","13"},{"17","19"}}).length);
+ System.out.println ((new String [][] {{"23","29"},{"31","37"}})[0][1]);
+ }
+}
--- /dev/null
+23
+57
+2
+29
--- /dev/null
+// Class instinit
+// Generated on Wed Feb 2 12:31:16 PST 2000
+// Simple instance initializer test case.
+
+class instinit extends foo {
+
+ String buffer = "No Oink! Oink!";
+
+ /* Instance initializer */
+ {
+ System.out.println ("Oinking...");
+ }
+ {
+ buffer = "Oink! Oink!";
+ }
+
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `instinit'...");
+ System.out.println (new instinit ().buffer);
+ }
+}
--- /dev/null
+Testing class `instinit'...
+Plain old boring foo
+Oinking...
+Oink! Oink!
--- /dev/null
+// Class ii2
+// Generated on Wed Feb 2 17:52:49 PST 2000
+// The instance initializer throws a checked exception. This is OK
+// since the constructors declares it in its `throws' clause -- at
+// least that's what the specs are saying.
+
+class ii2 {
+
+ String buffer = "Oink Oink!";
+
+ {
+ System.out.println ("Checking the oink...");
+ if (buffer != null)
+ throw new Exception ("It just oinked");
+ }
+
+ ii2 () throws Exception
+ {
+ System.out.println ("Ctor");
+ }
+
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `ii2'...");
+ try {
+ System.out.println (new ii2 ().buffer);
+ } catch (Exception e) {
+ System.out.println (e.toString());
+ }
+ }
+}
--- /dev/null
+Testing class `instinit2'...
+Ctor
+Checking the oink...
+java.lang.Exception: It just oinked
--- /dev/null
+// Class nested_with_ctor
+// Generated on Mon Jan 31 18:31:47 PST 2000
+// The nested class contains explicit constructors. Their argument
+// lists should be augmented with the alias initializer values when
+// the ctors are seen declared (as opposed to generated.)
+
+class nested_with_ctor {
+
+ void fct(final String s, final int i)
+ {
+ class nested {
+ String buffer = s+i;
+ String getString () { return buffer; }
+ nested (int i) { buffer = "(int)"+i; }
+ nested () {}
+ }
+ nested x = new nested ();
+ System.out.println (x.getString ());
+ nested y = new nested (123);
+ System.out.println (y.getString ());
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `nested_with_ctor'...");
+ new nested_with_ctor ().fct ("Yikes!", 321);
+ }
+}
--- /dev/null
+Testing class `nested_with_ctor'...
+Yikes!321
+(int)123
--- /dev/null
+// Class stub
+// Generated on Fri Feb 4 20:23:47 PST 2000
+// A somewhat thorough test of function invocator generated stubs.
+
+class stub {
+
+ String ok;
+
+ void OK () {System.out.println (ok);}
+ void OK (int i) {System.out.println (ok+" "+i);}
+ static void testOK () {System.out.println ("OK");}
+ static void testOK (int i) {System.out.println ("OK "+i); }
+
+ // STATIC PRIVATE R_VALUE ARGS
+ // No No No No
+ void t1 () {OK();}
+ // Yes No No No
+ static void t2 () {testOK();}
+ // No Yes No No
+ private void t3 () {OK();}
+ // Yes Yes No No
+ static private void t4 () {testOK();}
+ // No No Yes No
+ int t5 () {return 5;}
+ // Yes No Yes No
+ static int t6 () {return 6;}
+ // No Yes Yes No
+ private int t7 () {return 7;}
+ // Yes Yes Yes No
+ static private int t8 () {return 8;}
+
+ // No No No Yes
+ void t9 (int i) {OK(i);}
+ // Yes No No Yes
+ static void t10 (int i) {testOK(i);}
+ // No Yes No Yes
+ private void t11 (int i) {OK(i);}
+ // Yes Yes No Yes
+ static private void t12 (int i) {testOK(i);}
+ // No No Yes Yes
+ int t13 (int i) {return i*2;}
+ // Yes No Yes Yes
+ static int t14 (int i) {return i*3;}
+ // No Yes Yes Yes
+ private int t15 (int i) {return i*4;}
+ // Yes Yes Yes Yes
+ static private int t16 (int i) {return i*5;}
+
+ void foo ()
+ {
+ this.new bar ().test ();
+ }
+ class bar {
+ void test () {
+ ok = "OK";
+ t1 ();
+ t2 ();
+ t3 ();
+ t4 ();
+ System.out.println (t5());
+ System.out.println (t6());
+ System.out.println (t7());
+ System.out.println (t8());
+ t9 (9);
+ t10 (10);
+ t11 (11);
+ t12 (12);
+ System.out.println (t13(13));
+ System.out.println (t14(14));
+ System.out.println (t15(15));
+ System.out.println (t16(16));
+ this.new baz ().test ();
+ }
+ class baz {
+ void test () {
+ ok = "OKOK";
+ t1 ();
+ t2 ();
+ t3 ();
+ t4 ();
+ System.out.println (t5());
+ System.out.println (t6());
+ System.out.println (t7());
+ System.out.println (t8());
+ t9 (9);
+ t10 (10);
+ t11 (11);
+ t12 (12);
+ System.out.println (t13(13));
+ System.out.println (t14(14));
+ System.out.println (t15(15));
+ System.out.println (t16(16));
+ }
+ }
+ }
+ public static void main (String[] arg)
+ {
+ System.out.println ("Testing class `stub'...");
+ new stub ().foo ();
+ }
+}
--- /dev/null
+Testing class `stub'...
+OK
+OK
+OK
+OK
+5
+6
+7
+8
+OK 9
+OK 10
+OK 11
+OK 12
+26
+42
+60
+80
+OKOK
+OK
+OKOK
+OK
+5
+6
+7
+8
+OKOK 9
+OK 10
+OKOK 11
+OK 12
+26
+42
+60
+80