summaryrefslogtreecommitdiff
path: root/src/runtime/syscall_windows_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/syscall_windows_test.go')
-rw-r--r--src/runtime/syscall_windows_test.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/runtime/syscall_windows_test.go b/src/runtime/syscall_windows_test.go
index ce8a9ec1b..126bef62e 100644
--- a/src/runtime/syscall_windows_test.go
+++ b/src/runtime/syscall_windows_test.go
@@ -533,3 +533,11 @@ func main() {
println(z)
}
`
+
+func TestCallbackWithNoInputParameters(t *testing.T) {
+ // Test that NewCallback and NewCallbackCDecl can accept functions without
+ // input parameters, see issue 9871.
+ cb := func() uintptr { return 0 }
+ _ = syscall.NewCallback(cb)
+ _ = syscall.NewCallbackCDecl(cb)
+}