From f6f83e493819675511c09941a075e9637a48b7e9 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 31 Jan 2012 16:19:25 -0800 Subject: [PATCH] test: add test which crashed gccgo compiler R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5605046 --- test/fixedbugs/bug403.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/fixedbugs/bug403.go diff --git a/test/fixedbugs/bug403.go b/test/fixedbugs/bug403.go new file mode 100644 index 0000000000..ec02ca7333 --- /dev/null +++ b/test/fixedbugs/bug403.go @@ -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 +} -- 2.50.0