aboutsummaryrefslogtreecommitdiff
path: root/libgo/misc/cgo/testshared/testdata/issue30768
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2019-09-12 23:22:53 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2019-09-12 23:22:53 +0000
commit656297e1fec9a127ff742df16958ee279ccacec5 (patch)
tree24347a35dacea36ce742c32c17420f3e31f17e3d /libgo/misc/cgo/testshared/testdata/issue30768
parentd6ecb707cc5a58816d27908a7aa324c4b0bc67bb (diff)
downloadgcc-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/testdata/issue30768')
-rw-r--r--libgo/misc/cgo/testshared/testdata/issue30768/issue30768lib/lib.go11
-rw-r--r--libgo/misc/cgo/testshared/testdata/issue30768/x_test.go22
2 files changed, 33 insertions, 0 deletions
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{})
+}