2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / libjava / testsuite / libjava.lang / pr109.java
blob17c4b2301bbc8f768624fd80c09693e14a833b55
1 // PR 109
3 // Running the test code produces the output "0" instead of the
4 // expected "01234".
6 // The break statement exits both for-loops (not just the innermost
7 // one) if the (single statement) body of the outer for-loop is not
8 // enclosed in braces. Affects more deeply nested loops in the same
9 // way.
11 public class pr109
13 public static void main (String argv[])
15 int i, j;
17 for (i = 0; i < 5; i++)
18 for (j = 0; j < 2; j++)
20 if (j == 1)
21 break;
22 System.out.print (i);
25 // We print a newline here because otherwise the DejaGNU log
26 // file is screwed up.
27 System.out.println ();