From: Than McIntosh Date: Wed, 24 Apr 2019 12:27:04 +0000 (-0400) Subject: test: new test for issue 31637 X-Git-Tag: go1.13beta1~563 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=57076b8e6edb6ee19b86ab349b8f7a85819e0085;p=gostls13.git test: new test for issue 31637 This pair of packages caused a crash in gollvm, due to a glitch in the way the front end handles empty/non-name parameters for functions that are inline candidates. Updates #31637. Change-Id: I571c0658a00974dd36025e571638c0c836a3cdfd Reviewed-on: https://go-review.googlesource.com/c/go/+/173617 Run-TryBot: Benny Siegert TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- diff --git a/test/fixedbugs/issue31637.dir/a.go b/test/fixedbugs/issue31637.dir/a.go new file mode 100644 index 0000000000..71f392697c --- /dev/null +++ b/test/fixedbugs/issue31637.dir/a.go @@ -0,0 +1,15 @@ +// Copyright 2019 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. + +package a + +type dO struct { + x int +} + +type EDO struct{} + +func (EDO) Apply(*dO) {} + +var X EDO diff --git a/test/fixedbugs/issue31637.dir/b.go b/test/fixedbugs/issue31637.dir/b.go new file mode 100644 index 0000000000..ce83b000df --- /dev/null +++ b/test/fixedbugs/issue31637.dir/b.go @@ -0,0 +1,19 @@ +// Copyright 2019 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. + +package main + +import "./a" + +type No struct { + a.EDO +} + +func X() No { + return No{} +} + +func main() { + X() +} diff --git a/test/fixedbugs/issue31637.go b/test/fixedbugs/issue31637.go new file mode 100644 index 0000000000..dcfb4a7e53 --- /dev/null +++ b/test/fixedbugs/issue31637.go @@ -0,0 +1,11 @@ +// compiledir + +// Copyright 2019 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. + +// This directory contains a pair of packages that triggered +// a compiler crash in gollvm (problem in handling an inlinable +// method with unnamed parameter). See issue 31637 for details. + +package ignored