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.
5 // Failed to resolve typedefs consistently.
6 // No runtime test; just make sure it compiles.
7 // In separate directory to isolate #pragma GCC diagnostic.
11 // We use the #pragma to avoid a compiler warning about incompatible
12 // pointer types, because we generate code passing a struct ptr rather
13 // than using the typedef. This warning is expected and does not break
15 // We can only disable -Wincompatible-pointer-types starting with GCC 5.
17 // #if __GNU_MAJOR__ >= 5
19 // #pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
23 // } issue27340Struct, *issue27340Ptr;
25 // static void issue27340CFunc(issue27340Ptr p) {}
27 // #else /* _GNU_MAJOR_ < 5 */
31 // } issue27340Struct;
33 // static issue27340Struct* issue27340Ptr(issue27340Struct* p) { return p; }
35 // static void issue27340CFunc(issue27340Struct *p) {}
36 // #endif /* _GNU_MAJOR_ < 5 */
39 func Issue27340GoFunc() {
40 var s C.issue27340Struct
41 C.issue27340CFunc(C.issue27340Ptr(&s))