From 538a58bb75ea86be27ba24597c4f45f0e84969ea Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 1 Nov 2012 13:54:09 -0700 Subject: [PATCH] misc/cgo/test: changes to pass when using gccgo R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6821067 --- misc/cgo/test/backdoor/runtime.c | 2 ++ misc/cgo/test/backdoor/runtime_gccgo.c | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 misc/cgo/test/backdoor/runtime_gccgo.c diff --git a/misc/cgo/test/backdoor/runtime.c b/misc/cgo/test/backdoor/runtime.c index 54e6a1ef8be..194a9c8e4e0 100644 --- a/misc/cgo/test/backdoor/runtime.c +++ b/misc/cgo/test/backdoor/runtime.c @@ -6,6 +6,8 @@ // Must be in a non-cgo-using package so that // the go command compiles this file with 6c, not gcc. +// +build gc + typedef char bool; bool runtime·lockedOSThread(void); diff --git a/misc/cgo/test/backdoor/runtime_gccgo.c b/misc/cgo/test/backdoor/runtime_gccgo.c new file mode 100644 index 00000000000..218b2c3ebcd --- /dev/null +++ b/misc/cgo/test/backdoor/runtime_gccgo.c @@ -0,0 +1,18 @@ +// Copyright 2012 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. + +// Expose some runtime functions for testing. +// This is the gccgo version of runtime.c. + +// +build gccgo + +_Bool runtime_lockedOSThread(void); + +_Bool LockedOSThread(void) asm(GOPKGPATH ".LockedOSThread"); + +_Bool +LockedOSThread(void) +{ + return runtime_lockedOSThread(); +}