Skip to content

Commit 57076b8

Browse files
committed
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 <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 562b7c2 commit 57076b8

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

test/fixedbugs/issue31637.dir/a.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2019 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package a
6+
7+
type dO struct {
8+
x int
9+
}
10+
11+
type EDO struct{}
12+
13+
func (EDO) Apply(*dO) {}
14+
15+
var X EDO

test/fixedbugs/issue31637.dir/b.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2019 The Go Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
package main
6+
7+
import "./a"
8+
9+
type No struct {
10+
a.EDO
11+
}
12+
13+
func X() No {
14+
return No{}
15+
}
16+
17+
func main() {
18+
X()
19+
}

test/fixedbugs/issue31637.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// compiledir
2+
3+
// Copyright 2019 The Go Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style
5+
// license that can be found in the LICENSE file.
6+
7+
// This directory contains a pair of packages that triggered
8+
// a compiler crash in gollvm (problem in handling an inlinable
9+
// method with unnamed parameter). See issue 31637 for details.
10+
11+
package ignored

0 commit comments

Comments
 (0)