2012-02-17 04:50:37 +00:00
|
|
|
// run
|
2008-06-06 21:27:34 +00:00
|
|
|
|
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2012-02-24 05:24:24 +00:00
|
|
|
// Test goto and labels.
|
|
|
|
|
2008-06-06 21:27:34 +00:00
|
|
|
package main
|
|
|
|
|
2012-01-18 21:20:55 +00:00
|
|
|
func main() {
|
|
|
|
i := 0
|
2008-06-06 21:27:34 +00:00
|
|
|
if false {
|
2012-01-18 21:20:55 +00:00
|
|
|
goto gogoloop
|
2008-06-06 21:27:34 +00:00
|
|
|
}
|
|
|
|
if false {
|
2012-01-18 21:20:55 +00:00
|
|
|
goto gogoloop
|
2008-06-06 21:27:34 +00:00
|
|
|
}
|
|
|
|
if false {
|
2012-01-18 21:20:55 +00:00
|
|
|
goto gogoloop
|
2008-06-06 21:27:34 +00:00
|
|
|
}
|
2012-01-18 21:20:55 +00:00
|
|
|
goto gogoloop
|
2008-06-06 21:27:34 +00:00
|
|
|
|
2012-01-18 21:20:55 +00:00
|
|
|
// backward declared
|
2008-06-06 21:27:34 +00:00
|
|
|
loop:
|
2012-01-18 21:20:55 +00:00
|
|
|
i = i + 1
|
2008-06-06 21:27:34 +00:00
|
|
|
if i < 100 {
|
2012-01-18 21:20:55 +00:00
|
|
|
goto loop
|
2008-06-06 21:27:34 +00:00
|
|
|
}
|
2012-01-18 21:20:55 +00:00
|
|
|
return
|
2008-06-06 21:27:34 +00:00
|
|
|
|
|
|
|
gogoloop:
|
2012-01-18 21:20:55 +00:00
|
|
|
goto loop
|
2008-06-06 21:27:34 +00:00
|
|
|
}
|