diff options
author | Cherry Zhang <cherryyz@google.com> | 2019-12-11 11:44:08 -0500 |
---|---|---|
committer | Cherry Zhang <cherryyz@google.com> | 2019-12-11 19:48:39 +0000 |
commit | 6f2b8347b148bb7aab1a89423d18ec0cbca6ffb4 (patch) | |
tree | 6e7e7bc8f5e029fc03a851dfac2cca0afe714a86 | |
parent | 9d78e75a0a55fd5ff3d68b4cba2f0395c4b5dc88 (diff) | |
download | go-6f2b8347b148bb7aab1a89423d18ec0cbca6ffb4.tar.gz go-6f2b8347b148bb7aab1a89423d18ec0cbca6ffb4.zip |
test: add a test for gccgo compiler bug of missing type descriptor
The gccgo compiler did not generate type descriptor for a pointer
to a type alias defined in another package, causing linking error.
The fix is CL 210787. This CL adds a test.
Updates #36085.
Change-Id: I3237c7fedb4d92fb2dc610ee2b88087f96dc2a1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/210858
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
-rw-r--r-- | test/fixedbugs/issue36085.dir/a.go | 3 | ||||
-rw-r--r-- | test/fixedbugs/issue36085.dir/b.go | 8 | ||||
-rw-r--r-- | test/fixedbugs/issue36085.go | 11 |
3 files changed, 22 insertions, 0 deletions
diff --git a/test/fixedbugs/issue36085.dir/a.go b/test/fixedbugs/issue36085.dir/a.go new file mode 100644 index 0000000000..07cabcd2cc --- /dev/null +++ b/test/fixedbugs/issue36085.dir/a.go @@ -0,0 +1,3 @@ +package a + +type W = map[int32]interface{} diff --git a/test/fixedbugs/issue36085.dir/b.go b/test/fixedbugs/issue36085.dir/b.go new file mode 100644 index 0000000000..c5ee26970a --- /dev/null +++ b/test/fixedbugs/issue36085.dir/b.go @@ -0,0 +1,8 @@ +package main + +import "a" + +var w a.W +var X interface{} = &w + +func main() {} diff --git a/test/fixedbugs/issue36085.go b/test/fixedbugs/issue36085.go new file mode 100644 index 0000000000..69d4490fd5 --- /dev/null +++ b/test/fixedbugs/issue36085.go @@ -0,0 +1,11 @@ +// compiledir + +// Copyright 2019 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 36085: gccgo compiler did not generate type descriptor +// for pointer to type alias defined in another package, causing +// linking error. + +package ignored |