summaryrefslogtreecommitdiff
path: root/test/fixedbugs
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-05-19 15:08:04 -0400
committerRuss Cox <rsc@golang.org>2014-05-19 15:08:04 -0400
commitd7bf94fb5ba0a8d5c2d7a336f7f316a1148b1be4 (patch)
treea5735df5558f046b4d9e6727e637ae8569d06a78 /test/fixedbugs
parentac908e418ceb19df213d81f638a4a3ef82708126 (diff)
downloadgo-d7bf94fb5ba0a8d5c2d7a336f7f316a1148b1be4.tar.gz
cmd/gc: fix <-<-expr
The temporary-introducing pass was not recursing into the argumnt of a receive operation. Fixes issue 8011. LGTM=r R=golang-codereviews, r CC=golang-codereviews, iant, khr https://codereview.appspot.com/91540043
Diffstat (limited to 'test/fixedbugs')
-rw-r--r--test/fixedbugs/issue8011.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/fixedbugs/issue8011.go b/test/fixedbugs/issue8011.go
new file mode 100644
index 000000000..b966174c0
--- /dev/null
+++ b/test/fixedbugs/issue8011.go
@@ -0,0 +1,18 @@
+// run
+
+// Copyright 2014 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() {
+ c := make(chan chan int, 1)
+ c1 := make(chan int, 1)
+ c1 <- 42
+ c <- c1
+ x := <-<-c
+ if x != 42 {
+ println("BUG:", x, "!= 42")
+ }
+}