From 60ea2c594bdfb8d0ae4e13c8a028e59ed07bf9a9 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 16 Dec 2014 15:53:41 -0800 Subject: [PATCH] test: add test that gccgo failed to compile Gccgo failed to create the type descriptor for the type used to allocate the nil value passed to append as the second argument when append is called with only one argument. Calling append with only one argument is unusual but obviously should not cause a compiler crash. Change-Id: I530821847dfd68f0302de6ca6a84dfbc79653935 Reviewed-on: https://go-review.googlesource.com/1692 Reviewed-by: Minux Ma Reviewed-by: Brad Fitzpatrick --- test/fixedbugs/bug493.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/fixedbugs/bug493.go diff --git a/test/fixedbugs/bug493.go b/test/fixedbugs/bug493.go new file mode 100644 index 0000000000..643e9af4b8 --- /dev/null +++ b/test/fixedbugs/bug493.go @@ -0,0 +1,15 @@ +// compile + +// 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. + +// Test case that gccgo failed to compile. + +package p + +func F() []string { + return []string{""} +} + +var V = append(F()) -- 2.50.0