]> Cypherpunks.ru repositories - gostls13.git/blob - src/cmd/cgo/internal/testso/testdata/cgoso_unix.go
misc/cgo: move easy tests to cmd/cgo/internal
[gostls13.git] / src / cmd / cgo / internal / 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 }