mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00:00
Change-Id: I5d02279d0593a8368b2f249a6b53650b89aed7b7 Reviewed-on: https://go-review.googlesource.com/c/go/+/482275 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
30 lines
503 B
Go
30 lines
503 B
Go
// Copyright 2017 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.
|
|
|
|
//go:build ignore
|
|
// +build ignore
|
|
|
|
package main
|
|
|
|
import (
|
|
"log"
|
|
"plugin"
|
|
)
|
|
|
|
func main() {
|
|
p, err := plugin.Open("issue.22295.so")
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
f, err := p.Lookup("F")
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
const want = 2503
|
|
got := f.(func() int)()
|
|
if got != want {
|
|
log.Fatalf("got %d, want %d", got, want)
|
|
}
|
|
}
|