]> Cypherpunks.ru repositories - gostls13.git/blob - misc/cgo/testgodefs/testdata/anonunion.go
9e9daa662513f9c5594df5727564c7e1e1411625
[gostls13.git] / misc / cgo / testgodefs / testdata / anonunion.go
1 // Copyright 2014 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 //go:build ignore
6 // +build ignore
7
8 package main
9
10 // This file tests that when cgo -godefs sees a struct with a field
11 // that is an anonymous union, the first field in the union is
12 // promoted to become a field of the struct.  See issue 6677 for
13 // background.
14
15 /*
16 typedef struct {
17         union {
18                 long l;
19                 int c;
20         };
21 } t;
22 */
23 import "C"
24
25 // Input for cgo -godefs.
26
27 type T C.t