mirror of
https://github.com/golang/go
synced 2024-09-29 05:14:29 -06:00
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>
This commit is contained in:
parent
408f7a4663
commit
ab3c2b6d89
@ -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;
|
@ -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
|
||||
|
||||
|
13
src/cmd/cgo/internal/testtls/tls_none.go
Normal file
13
src/cmd/cgo/internal/testtls/tls_none.go
Normal file
@ -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")
|
||||
}
|
@ -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"
|
||||
|
2
src/cmd/dist/test.go
vendored
2
src/cmd/dist/test.go
vendored
@ -1129,6 +1129,7 @@ func (t *tester) registerCgoTests(heading string) {
|
||||
}
|
||||
|
||||
cgoTest("auto", "test", "auto", "")
|
||||
cgoTest("auto", "testtls", "auto", "")
|
||||
|
||||
// Stub out various buildmode=pie tests on alpine until 54354 resolved.
|
||||
builderName := os.Getenv("GO_BUILDER_NAME")
|
||||
@ -1162,7 +1163,6 @@ func (t *tester) registerCgoTests(heading string) {
|
||||
gt := cgoTest("external-g0", "test", "external", "")
|
||||
gt.env = append(gt.env, "CGO_CFLAGS=-g0 -fdiagnostics-color")
|
||||
|
||||
cgoTest("auto", "testtls", "auto", "")
|
||||
cgoTest("external", "testtls", "external", "")
|
||||
switch {
|
||||
case os == "aix":
|
||||
|
Loading…
Reference in New Issue
Block a user