diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/cgo/test/cgo_test.go | 1 | ||||
-rw-r--r-- | misc/cgo/test/issue23356.go | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/misc/cgo/test/cgo_test.go b/misc/cgo/test/cgo_test.go index 4462df0059..4c7f676e0b 100644 --- a/misc/cgo/test/cgo_test.go +++ b/misc/cgo/test/cgo_test.go @@ -89,6 +89,7 @@ func Test21897(t *testing.T) { test21897(t) } func Test22906(t *testing.T) { test22906(t) } func Test24206(t *testing.T) { test24206(t) } func Test25143(t *testing.T) { test25143(t) } +func Test23356(t *testing.T) { test23356(t) } func BenchmarkCgoCall(b *testing.B) { benchCgoCall(b) } func BenchmarkGoString(b *testing.B) { benchGoString(b) } diff --git a/misc/cgo/test/issue23356.go b/misc/cgo/test/issue23356.go new file mode 100644 index 0000000000..1c390120c8 --- /dev/null +++ b/misc/cgo/test/issue23356.go @@ -0,0 +1,19 @@ +// 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 cgotest + +// int a(void) { return 5; }; +// int r(void) { return 3; }; +import "C" +import "testing" + +func test23356(t *testing.T) { + if got, want := C.a(), C.int(5); got != want { + t.Errorf("C.a() == %v, expected %v", got, want) + } + if got, want := C.r(), C.int(3); got != want { + t.Errorf("C.r() == %v, expected %v", got, want) + } +} |