Skip to content

Commit b8dc931

Browse files
misc/cgo/test: add test for passing compatible typedefs
Fixes #23720 Change-Id: I28e0c16503bc043f793e0dab19668f7a66313312 Reviewed-on: https://go-review.googlesource.com/118737 Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 67d276c commit b8dc931

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

misc/cgo/test/issue23720.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2018 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.
4+
5+
// Test that we can pass compatible typedefs.
6+
// No runtime test; just make sure it compiles.
7+
8+
package cgotest
9+
10+
/*
11+
typedef int *issue23720A;
12+
13+
typedef const int *issue23720B;
14+
15+
void issue23720F(issue23720B a) {}
16+
*/
17+
import "C"
18+
19+
func Issue23720F() {
20+
var x C.issue23720A
21+
C.issue23720F(x)
22+
}

0 commit comments

Comments
 (0)