From 155612a9b981eb32b2312659409fc46bac535c90 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 24 Jun 2022 17:13:30 -0700 Subject: [PATCH] test: add test that caused gofrontend crash The gofrontend crashed importing a complex 0 constant. For #52862 Change-Id: Ia87d8eadb9c5ddf51e1cd65c1a626f05f0d068d4 Reviewed-on: https://go-review.googlesource.com/c/go/+/413980 Reviewed-by: Cherry Mui Run-TryBot: Ian Lance Taylor TryBot-Result: Gopher Robot Reviewed-by: Than McIntosh --- test/fixedbugs/issue52862.dir/a.go | 9 +++++++++ test/fixedbugs/issue52862.dir/b.go | 11 +++++++++++ test/fixedbugs/issue52862.go | 9 +++++++++ 3 files changed, 29 insertions(+) create mode 100644 test/fixedbugs/issue52862.dir/a.go create mode 100644 test/fixedbugs/issue52862.dir/b.go create mode 100644 test/fixedbugs/issue52862.go diff --git a/test/fixedbugs/issue52862.dir/a.go b/test/fixedbugs/issue52862.dir/a.go new file mode 100644 index 0000000000..ef4ce2025c --- /dev/null +++ b/test/fixedbugs/issue52862.dir/a.go @@ -0,0 +1,9 @@ +// Copyright 2022 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 + +func F() complex128 { + return 0+0i +} diff --git a/test/fixedbugs/issue52862.dir/b.go b/test/fixedbugs/issue52862.dir/b.go new file mode 100644 index 0000000000..739af663f7 --- /dev/null +++ b/test/fixedbugs/issue52862.dir/b.go @@ -0,0 +1,11 @@ +// Copyright 2022 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 b + +import "./a" + +func F() complex128 { + return a.F() +} diff --git a/test/fixedbugs/issue52862.go b/test/fixedbugs/issue52862.go new file mode 100644 index 0000000000..322d5f6c49 --- /dev/null +++ b/test/fixedbugs/issue52862.go @@ -0,0 +1,9 @@ +// compiledir + +// Copyright 2022 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. + +// gofrontend crash importing a complex zero value. + +package ignored -- 2.48.1