introduce TDF_compare_debug, omit OBJ_TYPE_REF casts with it
[official-gcc.git] / libgo / misc / cgo / test / issue11925.go
blobc5c8a269f79d2856a4b0504c76326d54f5e679d0
1 // Copyright 2015 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 // Issue 11925. Structs with zero-length trailing fields are now
6 // padded by the Go compiler.
8 package cgotest
11 struct a11925 {
12 int i;
13 char a[0];
14 char b[0];
17 struct b11925 {
18 int i;
19 char a[0];
20 char b[];
23 import "C"
25 import (
26 "testing"
27 "unsafe"
30 func test11925(t *testing.T) {
31 if C.sizeof_struct_a11925 != unsafe.Sizeof(C.struct_a11925{}) {
32 t.Errorf("size of a changed: C %d, Go %d", C.sizeof_struct_a11925, unsafe.Sizeof(C.struct_a11925{}))
34 if C.sizeof_struct_b11925 != unsafe.Sizeof(C.struct_b11925{}) {
35 t.Errorf("size of b changed: C %d, Go %d", C.sizeof_struct_b11925, unsafe.Sizeof(C.struct_b11925{}))