diff options
author | Martin Jambor <mjambor@suse.cz> | 2017-07-31 14:43:24 +0200 |
---|---|---|
committer | Martin Jambor <mjambor@suse.cz> | 2017-07-31 14:43:24 +0200 |
commit | b32f12dece884f1fa0f04c643a77105aff6ce8bc (patch) | |
tree | cdab5f10806561fc198f907299b0e55eb5701ef0 /libgo/misc/cgo/testplugin/test.bash | |
parent | 166bec868d991fdf71f9a66f994e5977fcab4aa2 (diff) | |
parent | a168a775e93ec31ae743ad282d8e60fa1c116891 (diff) | |
download | gcc-gcn.tar.gz |
Merge branch 'master' into gcngcn
Diffstat (limited to 'libgo/misc/cgo/testplugin/test.bash')
-rw-r--r-- | libgo/misc/cgo/testplugin/test.bash | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/libgo/misc/cgo/testplugin/test.bash b/libgo/misc/cgo/testplugin/test.bash new file mode 100644 index 00000000000..ab7430acc37 --- /dev/null +++ b/libgo/misc/cgo/testplugin/test.bash @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# Copyright 2016 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. + +set -e + +if [ ! -f src/host/host.go ]; then + cwd=$(pwd) + echo "misc/cgo/testplugin/test.bash is running in $cwd" 1>&2 + exit 1 +fi + +goos=$(go env GOOS) +goarch=$(go env GOARCH) + +function cleanup() { + rm -f plugin*.so unnamed*.so iface*.so + rm -rf host pkg sub iface issue18676 +} +trap cleanup EXIT + +rm -rf pkg sub +mkdir sub + +GOPATH=$(pwd) go build -buildmode=plugin plugin1 +GOPATH=$(pwd) go build -buildmode=plugin plugin2 +GOPATH=$(pwd)/altpath go build -buildmode=plugin plugin-mismatch +GOPATH=$(pwd) go build -buildmode=plugin -o=sub/plugin1.so sub/plugin1 +GOPATH=$(pwd) go build -buildmode=plugin unnamed1.go +GOPATH=$(pwd) go build -buildmode=plugin unnamed2.go +GOPATH=$(pwd) go build host + +LD_LIBRARY_PATH=$(pwd) ./host + +# Test that types and itabs get properly uniqified. +GOPATH=$(pwd) go build -buildmode=plugin iface_a +GOPATH=$(pwd) go build -buildmode=plugin iface_b +GOPATH=$(pwd) go build iface +LD_LIBRARY_PATH=$(pwd) ./iface + +# Test for issue 18676 - make sure we don't add the same itab twice. +# The buggy code hangs forever, so use a timeout to check for that. +GOPATH=$(pwd) go build -buildmode=plugin -o plugin.so src/issue18676/plugin.go +GOPATH=$(pwd) go build -o issue18676 src/issue18676/main.go +timeout 10s ./issue18676 |