From 73df946d56c74384511a194dd01dbe099584fd1a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 15:14:23 +0200 Subject: Adding upstream version 1.16.10. Signed-off-by: Daniel Baumann --- misc/cgo/test/testdata/gcc68255/a.go | 17 +++++++++++++++++ misc/cgo/test/testdata/gcc68255/c.c | 8 ++++++++ misc/cgo/test/testdata/gcc68255/c.h | 5 +++++ 3 files changed, 30 insertions(+) create mode 100644 misc/cgo/test/testdata/gcc68255/a.go create mode 100644 misc/cgo/test/testdata/gcc68255/c.c create mode 100644 misc/cgo/test/testdata/gcc68255/c.h (limited to 'misc/cgo/test/testdata/gcc68255') diff --git a/misc/cgo/test/testdata/gcc68255/a.go b/misc/cgo/test/testdata/gcc68255/a.go new file mode 100644 index 0000000..e106dee --- /dev/null +++ b/misc/cgo/test/testdata/gcc68255/a.go @@ -0,0 +1,17 @@ +// Copyright 2015 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. + +// Test that it's OK to have C code that does nothing other than +// initialize a global variable. This used to fail with gccgo. + +package gcc68255 + +/* +#include "c.h" +*/ +import "C" + +func F() bool { + return C.v != nil +} diff --git a/misc/cgo/test/testdata/gcc68255/c.c b/misc/cgo/test/testdata/gcc68255/c.c new file mode 100644 index 0000000..a4fe193 --- /dev/null +++ b/misc/cgo/test/testdata/gcc68255/c.c @@ -0,0 +1,8 @@ +// Copyright 2015 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. + +static void f(void) { +} + +void (*v)(void) = f; diff --git a/misc/cgo/test/testdata/gcc68255/c.h b/misc/cgo/test/testdata/gcc68255/c.h new file mode 100644 index 0000000..05ecd81 --- /dev/null +++ b/misc/cgo/test/testdata/gcc68255/c.h @@ -0,0 +1,5 @@ +// Copyright 2015 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. + +extern void (*v)(void); -- cgit v1.2.3