]> Cypherpunks repositories - gostls13.git/commitdiff
test: add test that caused gofrontend crash
authorIan Lance Taylor <iant@golang.org>
Sat, 25 Jun 2022 00:13:30 +0000 (17:13 -0700)
committerIan Lance Taylor <iant@golang.org>
Mon, 27 Jun 2022 16:12:51 +0000 (16:12 +0000)
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 <cherryyz@google.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
test/fixedbugs/issue52862.dir/a.go [new file with mode: 0644]
test/fixedbugs/issue52862.dir/b.go [new file with mode: 0644]
test/fixedbugs/issue52862.go [new file with mode: 0644]

diff --git a/test/fixedbugs/issue52862.dir/a.go b/test/fixedbugs/issue52862.dir/a.go
new file mode 100644 (file)
index 0000000..ef4ce20
--- /dev/null
@@ -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 (file)
index 0000000..739af66
--- /dev/null
@@ -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 (file)
index 0000000..322d5f6
--- /dev/null
@@ -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