mirror of
https://github.com/golang/go
synced 2024-11-13 18:50:24 -07:00
f2e7fa9d77
Clang 3.2 and older (as shipped with OS X Mountain Lion and older) outputs ambiguous DWARF debug info that makes it impossible for us to reconstruct accurate type information as required for this test. Fixes #8611. LGTM=rsc R=r, rsc, minux CC=golang-codereviews https://golang.org/cl/135990043
53 lines
972 B
Go
53 lines
972 B
Go
// Copyright 2014 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// This test fails on older versions of OS X because they use older buggy
|
|
// versions of Clang that emit ambiguous DWARF info. See issue 8611.
|
|
// +build !darwin
|
|
|
|
package cgotest
|
|
|
|
// Issue 8428. Cgo inconsistently translated zero size arrays.
|
|
|
|
/*
|
|
struct issue8428one {
|
|
char b;
|
|
char rest[];
|
|
};
|
|
|
|
struct issue8428two {
|
|
void *p;
|
|
char b;
|
|
char rest[0];
|
|
};
|
|
|
|
struct issue8428three {
|
|
char w[1][2][3][0];
|
|
char x[2][3][0][1];
|
|
char y[3][0][1][2];
|
|
char z[0][1][2][3];
|
|
};
|
|
*/
|
|
import "C"
|
|
|
|
import "unsafe"
|
|
|
|
var _ = C.struct_issue8428one{
|
|
b: C.char(0),
|
|
rest: [0]C.char{},
|
|
}
|
|
|
|
var _ = C.struct_issue8428two{
|
|
p: unsafe.Pointer(nil),
|
|
b: C.char(0),
|
|
rest: [0]C.char{},
|
|
}
|
|
|
|
var _ = C.struct_issue8428three{
|
|
w: [1][2][3][0]C.char{},
|
|
x: [2][3][0][1]C.char{},
|
|
y: [3][0][1][2]C.char{},
|
|
z: [0][1][2][3]C.char{},
|
|
}
|