diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-05-31 21:42:53 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2018-05-31 21:42:53 +0000 |
commit | 11309337c4056975c0fbd83a8caee7663617bef2 (patch) | |
tree | 1d3b985ef7b1360b336c30a1d687a849a70ecc4a /libgo/misc | |
parent | 8b0b334af3439179947522206b2478a28b908e61 (diff) | |
download | gcc-11309337c4056975c0fbd83a8caee7663617bef2.zip gcc-11309337c4056975c0fbd83a8caee7663617bef2.tar.gz gcc-11309337c4056975c0fbd83a8caee7663617bef2.tar.bz2 |
libgo: update to Go 1.10.2 release
Reviewed-on: https://go-review.googlesource.com/115196
From-SVN: r261041
Diffstat (limited to 'libgo/misc')
-rw-r--r-- | libgo/misc/cgo/testplugin/src/issue24351/main.go | 21 | ||||
-rw-r--r-- | libgo/misc/cgo/testplugin/src/issue24351/plugin.go | 14 | ||||
-rw-r--r-- | libgo/misc/cgo/testplugin/test.bash | 5 | ||||
-rw-r--r-- | libgo/misc/cgo/testshared/shared_test.go | 1 |
4 files changed, 41 insertions, 0 deletions
diff --git a/libgo/misc/cgo/testplugin/src/issue24351/main.go b/libgo/misc/cgo/testplugin/src/issue24351/main.go new file mode 100644 index 0000000..4107adf --- /dev/null +++ b/libgo/misc/cgo/testplugin/src/issue24351/main.go @@ -0,0 +1,21 @@ +// Copyright 2018 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 main + +import "plugin" + +func main() { + p, err := plugin.Open("issue24351.so") + if err != nil { + panic(err) + } + f, err := p.Lookup("B") + if err != nil { + panic(err) + } + c := make(chan bool) + f.(func(chan bool))(c) + <-c +} diff --git a/libgo/misc/cgo/testplugin/src/issue24351/plugin.go b/libgo/misc/cgo/testplugin/src/issue24351/plugin.go new file mode 100644 index 0000000..db17e0a --- /dev/null +++ b/libgo/misc/cgo/testplugin/src/issue24351/plugin.go @@ -0,0 +1,14 @@ +// Copyright 2018 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 main + +import "fmt" + +func B(c chan bool) { + go func() { + fmt.Println(1.5) + c <- true + }() +} diff --git a/libgo/misc/cgo/testplugin/test.bash b/libgo/misc/cgo/testplugin/test.bash index 18e3803..df38204 100644 --- a/libgo/misc/cgo/testplugin/test.bash +++ b/libgo/misc/cgo/testplugin/test.bash @@ -85,3 +85,8 @@ GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" -o issue22175 src/issue22175/main. GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" -buildmode=plugin -o issue.22295.so issue22295.pkg GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" -o issue22295 src/issue22295.pkg/main.go ./issue22295 + +# Test for issue 24351 +GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" -buildmode=plugin -o issue24351.so src/issue24351/plugin.go +GOPATH=$(pwd) go build -gcflags "$GO_GCFLAGS" -o issue24351 src/issue24351/main.go +./issue24351 diff --git a/libgo/misc/cgo/testshared/shared_test.go b/libgo/misc/cgo/testshared/shared_test.go index cf049ec..a296005 100644 --- a/libgo/misc/cgo/testshared/shared_test.go +++ b/libgo/misc/cgo/testshared/shared_test.go @@ -790,6 +790,7 @@ func TestRebuilding(t *testing.T) { // If the .a file is newer than the .so, the .so is rebuilt (but not the .a) t.Run("newarchive", func(t *testing.T) { resetFileStamps() + AssertNotRebuilt(t, "new .a file before build", filepath.Join(gopathInstallDir, "depBase.a")) goCmd(t, "list", "-linkshared", "-f={{.ImportPath}} {{.Stale}} {{.StaleReason}} {{.Target}}", "depBase") AssertNotRebuilt(t, "new .a file before build", filepath.Join(gopathInstallDir, "depBase.a")) cleanup := touch(t, filepath.Join(gopathInstallDir, "depBase.a")) |