]> Cypherpunks repositories - gostls13.git/commitdiff
test: add test which crashed gccgo compiler
authorIan Lance Taylor <iant@golang.org>
Wed, 1 Feb 2012 00:19:25 +0000 (16:19 -0800)
committerIan Lance Taylor <iant@golang.org>
Wed, 1 Feb 2012 00:19:25 +0000 (16:19 -0800)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5605046

test/fixedbugs/bug403.go [new file with mode: 0644]

diff --git a/test/fixedbugs/bug403.go b/test/fixedbugs/bug403.go
new file mode 100644 (file)
index 0000000..ec02ca7
--- /dev/null
@@ -0,0 +1,23 @@
+// $G $D/$F.go
+
+// Copyright 2012 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.
+
+// Crashed gccgo.
+
+package p
+
+type S struct {
+       f interface{}
+}
+
+func F(p *S) bool {
+       v := p.f
+       switch a := v.(type) {
+       case nil:
+               _ = a
+               return true
+       }
+       return true
+}