diff --git a/src/cmd/gc/go.y b/src/cmd/gc/go.y index e8843a97e63..0a7cd0813bb 100644 --- a/src/cmd/gc/go.y +++ b/src/cmd/gc/go.y @@ -538,23 +538,11 @@ orange_stmt: $$ = nod(ORANGE, $1, $4); $$->etype = 0; // := flag } -| exprsym3 ':' exprsym3 '=' LRANGE expr - { - $$ = nod(OLIST, $1, $3); - $$ = nod(ORANGE, $$, $6); - $$->etype = 0; - } | exprsym3_list_r LCOLAS LRANGE expr { $$ = nod(ORANGE, $1, $4); $$->etype = 1; } -| exprsym3 ':' exprsym3 LCOLAS LRANGE expr - { - $$ = nod(OLIST, $1, $3); - $$ = nod(ORANGE, $$, $6); - $$->etype = 1; - } for_header: osimple_stmt ';' orange_stmt ';' osimple_stmt diff --git a/test/ken/chan1.go b/test/ken/chan1.go new file mode 100644 index 00000000000..c6d7825b77f --- /dev/null +++ b/test/ken/chan1.go @@ -0,0 +1,56 @@ +// $G $D/$F.go && $L $F.$A && ./$A.out + +// 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 + +const N = 1000; // sent messages +const M = 10; // receiving goroutines +const W = 2; // channel buffering +var h [N]int; // marking of send/recv + +func +r(c chan int, m int) +{ + for { + select { + case r := <- c: + if h[r] != 1 { + panicln("r", + "m=", m, + "r=", r, + "h=", h[r] + ); + } + h[r] = 2; + } + } +} + +func +s(c chan int) +{ + for n:=0; n