]> Cypherpunks.ru repositories - gostls13.git/commitdiff
test: add test that caused a gofrontend crash
authorIan Lance Taylor <iant@golang.org>
Tue, 28 Mar 2023 19:51:35 +0000 (12:51 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 28 Mar 2023 20:27:13 +0000 (20:27 +0000)
For #55242

Change-Id: I092b1881623ea997b178d038c0afd10cd5bca937
Reviewed-on: https://go-review.googlesource.com/c/go/+/479898
Reviewed-by: Than McIntosh <thanm@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

test/fixedbugs/issue55242.go [new file with mode: 0644]

diff --git a/test/fixedbugs/issue55242.go b/test/fixedbugs/issue55242.go
new file mode 100644 (file)
index 0000000..4b29eb8
--- /dev/null
@@ -0,0 +1,18 @@
+// compile
+
+// Copyright 2023 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.
+
+// Issue 55242: gofrontend crash calling function that returns
+// trailing empty struct.
+
+package p
+
+func F1() (int, struct{}) {
+       return 0, struct{}{}
+}
+
+func F2() {
+       F1()
+}