mirror of
https://github.com/golang/go
synced 2024-11-25 04:17:57 -07:00
bcf3d55ed9
Fix build for 10.6 Darwin builders and OpenBSD builers. LGTM=jsing R=golang-codereviews, dave, jsing CC=golang-codereviews https://golang.org/cl/67710043
21 lines
400 B
Go
21 lines
400 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.
|
|
|
|
// +build dragonfly freebsd linux netbsd
|
|
|
|
package cgosotest
|
|
|
|
/*
|
|
extern int __thread tlsvar;
|
|
int *getTLS() { return &tlsvar; }
|
|
*/
|
|
import "C"
|
|
|
|
func init() {
|
|
if v := *C.getTLS(); v != 12345 {
|
|
println("got", v)
|
|
panic("BAD TLS value")
|
|
}
|
|
}
|