]> Cypherpunks.ru repositories - gostls13.git/blob - misc/cgo/testso/testdata/cgoso_unix.go
5164af5b3fbb745929a1a7f59a901e68651bf2fc
[gostls13.git] / misc / cgo / testso / testdata / cgoso_unix.go
1 // Copyright 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 //go:build aix || dragonfly || freebsd || linux || netbsd || solaris
6 // +build aix dragonfly freebsd linux netbsd solaris
7
8 package cgosotest
9
10 /*
11 extern int __thread tlsvar;
12 int *getTLS() { return &tlsvar; }
13 */
14 import "C"
15
16 func init() {
17         if v := *C.getTLS(); v != 12345 {
18                 println("got", v)
19                 panic("BAD TLS value")
20         }
21 }