File tree Expand file tree Collapse file tree 3 files changed +49
-2
lines changed Expand file tree Collapse file tree 3 files changed +49
-2
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright 2017 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ package main
6
+
7
+ import "plugin"
8
+
9
+ func main () {
10
+ p , err := plugin .Open ("plugin.so" )
11
+ if err != nil {
12
+ panic (err )
13
+ }
14
+
15
+ sym , err := p .Lookup ("G" )
16
+ if err != nil {
17
+ panic (err )
18
+ }
19
+ g := sym .(func () bool )
20
+ if ! g () {
21
+ panic ("expected types to match, Issue #18584" )
22
+ }
23
+ }
Original file line number Diff line number Diff line change
1
+ // Copyright 2017 The Go Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style
3
+ // license that can be found in the LICENSE file.
4
+
5
+ package main
6
+
7
+ import "reflect"
8
+
9
+ type C struct {
10
+ }
11
+
12
+ func F (c * C ) * C {
13
+ return nil
14
+ }
15
+
16
+ func G () bool {
17
+ var c * C
18
+ return reflect .TypeOf (F ).Out (0 ) == reflect .TypeOf (c )
19
+ }
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ goos=$(go env GOOS)
15
15
goarch=$( go env GOARCH)
16
16
17
17
function cleanup() {
18
- rm -f plugin* .so unnamed* .so iface* .so
19
- rm -rf host pkg sub iface issue18676 issue19534
18
+ rm -f plugin* .so unnamed* .so iface* .so issue *
19
+ rm -rf host pkg sub iface
20
20
}
21
21
trap cleanup EXIT
22
22
@@ -61,3 +61,8 @@ _timeout 10s ./issue18676
61
61
GOPATH=$( pwd) go build -gcflags " $GO_GCFLAGS " -buildmode=plugin -ldflags=' -pluginpath=issue.19534' -o plugin.so src/issue19534/plugin.go
62
62
GOPATH=$( pwd) go build -gcflags " $GO_GCFLAGS " -o issue19534 src/issue19534/main.go
63
63
./issue19534
64
+
65
+ # Test for issue 18584
66
+ GOPATH=$( pwd) go build -gcflags " $GO_GCFLAGS " -buildmode=plugin -o plugin.so src/issue18584/plugin.go
67
+ GOPATH=$( pwd) go build -gcflags " $GO_GCFLAGS " -o issue18584 src/issue18584/main.go
68
+ ./issue18584
You can’t perform that action at this time.
0 commit comments