OSDN Git Service

Add Go frontend, libgo library, and Go testsuite.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / go.test / test / fixedbugs / bug070.go
1 // $G $D/$F.go && $L $F.$A && ./$A.out
2
3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
6
7 package main
8
9 func main() {
10         var i, k int;
11         outer:
12         for k=0; k<2; k++ {
13                 print("outer loop top k ", k, "\n");
14                 if k != 0 { panic("k not zero") }  // inner loop breaks this one every time
15                 for i=0; i<2; i++ {
16                         if i != 0 { panic("i not zero") }  // loop breaks every time
17                         print("inner loop top i ", i, "\n");
18                         if true {
19                                 print("do break\n");
20                                 break outer;
21                         }
22                 }
23         }
24         print("broke\n");
25 }