From e1fcf8857e1b3e076cc3a6fad1860afe0d6c2ca6 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 20 Aug 2021 11:35:31 -0700 Subject: [PATCH] test: add test that caused gofrontend compiler crash Updates https://gcc.gnu.org/PR101994 Change-Id: I50dcb90e315792efd7d83b496034ad33b5f199e9 Reviewed-on: https://go-review.googlesource.com/c/go/+/343874 Trust: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Go Bot Reviewed-by: Than McIntosh --- test/fixedbugs/gcc101994.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/fixedbugs/gcc101994.go diff --git a/test/fixedbugs/gcc101994.go b/test/fixedbugs/gcc101994.go new file mode 100644 index 0000000000..6e1e2b8075 --- /dev/null +++ b/test/fixedbugs/gcc101994.go @@ -0,0 +1,16 @@ +// compile + +// Copyright 2021 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. + +// https://gcc.gnu.org/PR101994 +// gccgo compiler crash with zero-sized result. + +package p + +type Empty struct{} + +func F() (int, Empty) { + return 0, Empty{} +} -- 2.48.1