1 // Copyright 2013 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.
5 // API Compatibility Checks for cgo
11 // // Test for issue 17723.
12 // typedef char *cstring_pointer;
13 // static void cstring_pointer_fun(cstring_pointer dummy) { }
15 // const char *api_hello = "hello!";
21 cs
= C
.CString("hello")
22 defer C
.free(unsafe
.Pointer(cs
))
24 s
= C
.GoString((*C
.char
)(C
.api_hello
))
25 s
= C
.GoStringN((*C
.char
)(C
.api_hello
), C
.int(6))
27 b
= C
.GoBytes(unsafe
.Pointer(C
.api_hello
), C
.int(6))
29 C
.cstring_pointer_fun(nil)