From 6f6bbdf9b7de15b68b52649be35cd8b62a2edb9d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 15 May 2012 13:29:46 -0700 Subject: [PATCH] test: add bug439, valid code that caused a gccgo crash R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/6198075 --- test/fixedbugs/bug439.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/fixedbugs/bug439.go diff --git a/test/fixedbugs/bug439.go b/test/fixedbugs/bug439.go new file mode 100644 index 0000000000..87d4ae0373 --- /dev/null +++ b/test/fixedbugs/bug439.go @@ -0,0 +1,22 @@ +// compile + +// 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. + +// Gccgo used to crash compiling this. + +package p + +type E int + +func (e E) P() *E { return &e } + +const ( + C1 E = 0 + C2 = C1 +) + +func F() *E { + return C2.P() +} -- 2.48.1