mirror of
https://github.com/golang/go
synced 2024-11-17 12:14:47 -07:00
2230e9d24b
Change-Id: Ifd9ac7f5300232fb83c6350a787b5803adb96b48 Reviewed-on: https://go-review.googlesource.com/8263 Reviewed-by: Minux Ma <minux@golang.org>
21 lines
408 B
Go
21 lines
408 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 solaris
|
|
|
|
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")
|
|
}
|
|
}
|