bug140.go 440 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
// $G $D/$F.go || echo BUG should compile

// 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.

package main

func main() {
Russ Cox's avatar
Russ Cox committed
10 11 12
	if true {
	} else {
	L1:
Russ Cox's avatar
Russ Cox committed
13
		goto L1
Russ Cox's avatar
Russ Cox committed
14 15 16
	}
	if true {
	} else {
Russ Cox's avatar
Russ Cox committed
17
		goto L2
Russ Cox's avatar
Russ Cox committed
18 19 20
	L2:
		main()
	}
21 22 23 24
}

/*
These should be legal according to the spec.
25 26
bug140.go:6: syntax error near L1
bug140.go:7: syntax error near L2
27
*/