]> Cypherpunks repositories - gostls13.git/commitdiff
test: add a test that gccgo miscompiled
authorIan Lance Taylor <iant@golang.org>
Fri, 2 Feb 2018 19:16:56 +0000 (11:16 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Wed, 14 Feb 2018 20:13:07 +0000 (20:13 +0000)
Updates #20923

Change-Id: Ia1210ea3dec39e5db2521aeafca24d6e731f0c93
Reviewed-on: https://go-review.googlesource.com/91657
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
test/fixedbugs/issue20923.go [new file with mode: 0644]

diff --git a/test/fixedbugs/issue20923.go b/test/fixedbugs/issue20923.go
new file mode 100644 (file)
index 0000000..5fd1ad8
--- /dev/null
@@ -0,0 +1,19 @@
+// compile
+
+// Copyright 2018 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.
+
+// Issue 20923: gccgo failed to compile parenthesized select case expressions.
+
+package p
+
+func F(c chan bool) {
+       select {
+       case (<-c):
+       case _ = (<-c):
+       case _, _ = (<-c):
+       case (c) <- true:
+       default:
+       }
+}