1
0
mirror of https://github.com/golang/go synced 2024-11-13 18:10:24 -07:00
go/test/bugs/bug119.go
Ian Lance Taylor ce15158502 Test that a break statement inside a select statement breaks
out of the enclosing loop.

R=ken
DELTA=20  (20 added, 0 deleted, 0 changed)
OCL=18686
CL=18714
2008-11-06 15:24:10 -08:00

21 lines
382 B
Go

// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should not fail
// 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() {
a := new(chan bool);
for {
select {
case <- a:
panic();
default:
break;
}
panic();
}
}