]> Cypherpunks.ru repositories - gostls13.git/blob - misc/cgo/testso/testdata/cgoso_unix.go
ea9cb0a903c6f715431da84d359acf8e1538fb1b
[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
7 package cgosotest
8
9 /*
10 extern int __thread tlsvar;
11 int *getTLS() { return &tlsvar; }
12 */
13 import "C"
14
15 func init() {
16         if v := *C.getTLS(); v != 12345 {
17                 println("got", v)
18                 panic("BAD TLS value")
19         }
20 }