diff options
| author | Austin Clements <austin@google.com> | 2023-05-17 15:32:41 -0400 |
|---|---|---|
| committer | Austin Clements <austin@google.com> | 2023-05-19 01:37:35 +0000 |
| commit | ab3c2b6d89daa54679cdaa0d78d2902473e0d63b (patch) | |
| tree | 61940c3a0924ec6993be45165b3309bdc949bb97 /src/cmd/cgo | |
| parent | 408f7a4663fdb19357e2c0967eb442a1e5679b2d (diff) | |
| download | go-ab3c2b6d89daa54679cdaa0d78d2902473e0d63b.tar.xz | |
cmd/cgo/internal/testtls: build and run everywhere
This makes testtls build and run on all platforms in the default build
configuration (though it will Skip on some).
Change-Id: I6aba96a82d618c9798a0d4418b40b2644cfceec9
Reviewed-on: https://go-review.googlesource.com/c/go/+/496177
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Diffstat (limited to 'src/cmd/cgo')
| -rw-r--r-- | src/cmd/cgo/internal/testtls/tls.c (renamed from src/cmd/cgo/internal/testtls/tls_unix.c) | 4 | ||||
| -rw-r--r-- | src/cmd/cgo/internal/testtls/tls.go | 2 | ||||
| -rw-r--r-- | src/cmd/cgo/internal/testtls/tls_none.go | 13 | ||||
| -rw-r--r-- | src/cmd/cgo/internal/testtls/tls_test.go | 2 |
4 files changed, 18 insertions, 3 deletions
diff --git a/src/cmd/cgo/internal/testtls/tls_unix.c b/src/cmd/cgo/internal/testtls/tls.c index 957afce90d..0e2bbee542 100644 --- a/src/cmd/cgo/internal/testtls/tls_unix.c +++ b/src/cmd/cgo/internal/testtls/tls.c @@ -2,6 +2,10 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Darwin does not have __thread. + +//go:build cgo && unix && !darwin + #include <pthread.h> static __thread int tls; diff --git a/src/cmd/cgo/internal/testtls/tls.go b/src/cmd/cgo/internal/testtls/tls.go index 4684f82ebd..eb59ad41eb 100644 --- a/src/cmd/cgo/internal/testtls/tls.go +++ b/src/cmd/cgo/internal/testtls/tls.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build unix +//go:build cgo && unix && !darwin package cgotlstest diff --git a/src/cmd/cgo/internal/testtls/tls_none.go b/src/cmd/cgo/internal/testtls/tls_none.go new file mode 100644 index 0000000000..81c9c5e23d --- /dev/null +++ b/src/cmd/cgo/internal/testtls/tls_none.go @@ -0,0 +1,13 @@ +// Copyright 2023 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. + +//go:build !(cgo && unix && !darwin) + +package cgotlstest + +import "testing" + +func testTLS(t *testing.T) { + t.Skip("__thread is not supported") +} diff --git a/src/cmd/cgo/internal/testtls/tls_test.go b/src/cmd/cgo/internal/testtls/tls_test.go index 10b71f074e..8e14add988 100644 --- a/src/cmd/cgo/internal/testtls/tls_test.go +++ b/src/cmd/cgo/internal/testtls/tls_test.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build cgo && unix - package cgotlstest import "testing" |
