Skip to content

Commit

Permalink
test: add test that gccgo failed to compile
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Brad Fitzpatrick <[email protected]>
  • Loading branch information
ianlancetaylor committed Dec 17, 2014
1 parent 1b0b0db commit 60ea2c5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/fixedbugs/bug493.go
Original file line number Diff line number Diff line change
@@ -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())

0 comments on commit 60ea2c5

Please sign in to comment.