This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
new test case
- To: java-patches at sourceware dot cygnus dot com
- Subject: new test case
- From: Anthony Green <green at cygnus dot com>
- Date: Sun, 16 Jan 2000 11:31:57 -0800
New test case. It appears to be fixed already.
2000-01-16 Anthony Green <green@cygnus.com>
* libjava.lang/pr109.out: New file.
* libjava.lang/pr109.java: New file.
Index: libjava/testsuite/libjava.lang/pr109.java
===================================================================
RCS file: pr109.java
diff -N pr109.java
--- /dev/null Tue May 5 13:32:27 1998
+++ pr109.java Sun Jan 16 11:30:06 2000
@@ -0,0 +1,25 @@
+// PR 109
+
+// Running the test code produces the output "0" instead of the
+// expected "01234".
+
+// The break statement exits both for-loops (not just the innermost
+// one) if the (single statement) body of the outer for-loop is not
+// enclosed in braces. Affects more deeply nested loops in the same
+// way.
+
+public class pr109
+{
+ public static void main (String argv[])
+ {
+ int i, j;
+
+ for (i = 0; i < 5; i++)
+ for (j = 0; j < 2; j++)
+ {
+ if (j == 1)
+ break;
+ System.out.print (i);
+ }
+ }
+}
Index: libjava/testsuite/libjava.lang/pr109.out
===================================================================
RCS file: pr109.out
diff -N pr109.out
--- /dev/null Tue May 5 13:32:27 1998
+++ pr109.out Sun Jan 16 11:30:06 2000
@@ -0,0 +1 @@
+01234