diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-09-12 23:22:53 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2019-09-12 23:22:53 +0000 |
commit | 656297e1fec9a127ff742df16958ee279ccacec5 (patch) | |
tree | 24347a35dacea36ce742c32c17420f3e31f17e3d /libgo/misc/cgo/testshared | |
parent | d6ecb707cc5a58816d27908a7aa324c4b0bc67bb (diff) | |
download | gcc-656297e1fec9a127ff742df16958ee279ccacec5.zip gcc-656297e1fec9a127ff742df16958ee279ccacec5.tar.gz gcc-656297e1fec9a127ff742df16958ee279ccacec5.tar.bz2 |
libgo: update to Go1.13
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/194698
From-SVN: r275691
Diffstat (limited to 'libgo/misc/cgo/testshared')
-rw-r--r-- | libgo/misc/cgo/testshared/shared_test.go | 7 | ||||
-rw-r--r-- | libgo/misc/cgo/testshared/testdata/issue30768/issue30768lib/lib.go | 11 | ||||
-rw-r--r-- | libgo/misc/cgo/testshared/testdata/issue30768/x_test.go | 22 |
3 files changed, 40 insertions, 0 deletions
diff --git a/libgo/misc/cgo/testshared/shared_test.go b/libgo/misc/cgo/testshared/shared_test.go index ac1a1c7..9d16338 100644 --- a/libgo/misc/cgo/testshared/shared_test.go +++ b/libgo/misc/cgo/testshared/shared_test.go @@ -941,3 +941,10 @@ func TestTestInstalledShared(t *testing.T) { func TestGeneratedMethod(t *testing.T) { goCmd(t, "install", "-buildmode=shared", "-linkshared", "./issue25065") } + +// Test use of shared library struct with generated hash function. +// Issue 30768. +func TestGeneratedHash(t *testing.T) { + goCmd(nil, "install", "-buildmode=shared", "-linkshared", "./issue30768/issue30768lib") + goCmd(nil, "test", "-linkshared", "./issue30768") +} diff --git a/libgo/misc/cgo/testshared/testdata/issue30768/issue30768lib/lib.go b/libgo/misc/cgo/testshared/testdata/issue30768/issue30768lib/lib.go new file mode 100644 index 0000000..9e45ebe --- /dev/null +++ b/libgo/misc/cgo/testshared/testdata/issue30768/issue30768lib/lib.go @@ -0,0 +1,11 @@ +// 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. + +package issue30768lib + +// S is a struct that requires a generated hash function. +type S struct { + A string + B int +} diff --git a/libgo/misc/cgo/testshared/testdata/issue30768/x_test.go b/libgo/misc/cgo/testshared/testdata/issue30768/x_test.go new file mode 100644 index 0000000..1bbd139 --- /dev/null +++ b/libgo/misc/cgo/testshared/testdata/issue30768/x_test.go @@ -0,0 +1,22 @@ +// 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. + +package issue30768_test + +import ( + "testing" + + "testshared/issue30768/issue30768lib" +) + +type s struct { + s issue30768lib.S +} + +func Test30768(t *testing.T) { + // Calling t.Log will convert S to an empty interface, + // which will force a reference to the generated hash function, + // defined in the shared library. + t.Log(s{}) +} |