]> Cypherpunks repositories - gostls13.git/commitdiff
misc/cgo/test: changes to pass when using gccgo
authorIan Lance Taylor <iant@golang.org>
Thu, 1 Nov 2012 20:54:09 +0000 (13:54 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 1 Nov 2012 20:54:09 +0000 (13:54 -0700)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6821067

misc/cgo/test/backdoor/runtime.c
misc/cgo/test/backdoor/runtime_gccgo.c [new file with mode: 0644]

index 54e6a1ef8be70dcdd628a24ce9b46edfb5f5d0d1..194a9c8e4e05aa7b8e36b7e410043ff402f0f115 100644 (file)
@@ -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 (file)
index 0000000..218b2c3
--- /dev/null
@@ -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();
+}