summaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-02 17:21:10 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2002-07-02 17:21:10 +0000
commitca629b090bdacda75066d5efc0ba18b16331b2aa (patch)
treebadc81aa1b55d6996e2e3a9395617eeb26ef6e67 /libjava
parent644e79d769a754e69f9ebcfa0e9a58a8a867beab (diff)
downloadgcc-ca629b090bdacda75066d5efc0ba18b16331b2aa.tar.gz
2002-07-02 Andrew Haley <aph@redhat.com>
* libjava.lang/inline.java: New file. * libjava.lang/inline.out: Likewise. * libjava.lang/Array_3.java: Add another case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55186 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r--libjava/testsuite/ChangeLog7
-rw-r--r--libjava/testsuite/libjava.lang/Array_3.java19
-rw-r--r--libjava/testsuite/libjava.lang/inline.java35
-rw-r--r--libjava/testsuite/libjava.lang/inline.out2
4 files changed, 60 insertions, 3 deletions
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog
index 228e6f7bd0d..1bf2553f6d6 100644
--- a/libjava/testsuite/ChangeLog
+++ b/libjava/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2002-07-02 Andrew Haley <aph@redhat.com>
+
+ * libjava.lang/inline.java: New file.
+ * libjava.lang/inline.out: Likewise.
+
+ * libjava.lang/Array_3.java: Add another case.
+
2002-06-23 Tom Tromey <tromey@redhat.com>
* Makefile.in: Rebuilt.
diff --git a/libjava/testsuite/libjava.lang/Array_3.java b/libjava/testsuite/libjava.lang/Array_3.java
index f8b7ded4685..453387d51fb 100644
--- a/libjava/testsuite/libjava.lang/Array_3.java
+++ b/libjava/testsuite/libjava.lang/Array_3.java
@@ -27,7 +27,7 @@ public class Array_3
ok = true;
}
if (!ok)
- throw new RuntimeException("test failed");
+ throw new RuntimeException("test failed:1");
ok = false;
try
@@ -40,7 +40,7 @@ public class Array_3
ok = true;
}
if (!ok)
- throw new RuntimeException("test failed");
+ throw new RuntimeException("test failed:2");
ok = false;
try
@@ -54,6 +54,19 @@ public class Array_3
}
if (!ok || nn != 0)
- throw new RuntimeException("test failed");
+ throw new RuntimeException("test failed:3");
+
+ ok = false;
+ try
+ {
+ int[] x = (int[])null;
+ nn = x.length;
+ }
+ catch (NullPointerException _)
+ {
+ ok = true;
+ }
+ if (!ok)
+ throw new RuntimeException("test failed:4");
}
}
diff --git a/libjava/testsuite/libjava.lang/inline.java b/libjava/testsuite/libjava.lang/inline.java
new file mode 100644
index 00000000000..66585293491
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/inline.java
@@ -0,0 +1,35 @@
+public class inline
+{
+ static int factorial_1 (int n)
+ {
+ if (n > 0)
+ return n * factorial_1(n-1);
+ return 1;
+ }
+
+ static int factorial_2 (int n)
+ {
+ if (n > 0)
+ return n * factorial_3(n-1);
+ return 1;
+ }
+
+ static int factorial_3 (int n)
+ {
+ if (n > 0)
+ return n * factorial_2(n-1);
+ return 1;
+ }
+
+ public static void main(String args[])
+ {
+ if (factorial_1 (5) != 120)
+ System.out.println("This should not happen");
+ else
+ System.out.println("OK");
+ if (factorial_2 (5) != 120)
+ System.out.println("This should not happen");
+ else
+ System.out.println("OK");
+ }
+}
diff --git a/libjava/testsuite/libjava.lang/inline.out b/libjava/testsuite/libjava.lang/inline.out
new file mode 100644
index 00000000000..2c94e483710
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/inline.out
@@ -0,0 +1,2 @@
+OK
+OK