1 // Copyright 2017 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.
5 package sanitizers_test
13 func TestTSAN(t
*testing
.T
) {
14 if runtime
.GOARCH
== "arm64" {
15 t
.Skip("skipping test; see https://golang.org/issue/25682")
19 config
:= configure("thread")
20 config
.skipIfCSanitizerBroken(t
)
22 mustRun(t
, config
.goCmd("build", "std"))
32 {src
: "tsan5.go", needsRuntime
: true},
33 {src
: "tsan6.go", needsRuntime
: true},
34 {src
: "tsan7.go", needsRuntime
: true},
37 {src
: "tsan10.go", needsRuntime
: true},
38 {src
: "tsan11.go", needsRuntime
: true},
39 {src
: "tsan12.go", needsRuntime
: true},
41 for _
, tc
:= range cases
{
43 name
:= strings
.TrimSuffix(tc
.src
, ".go")
44 t
.Run(name
, func(t
*testing
.T
) {
48 defer dir
.RemoveAll(t
)
50 outPath
:= dir
.Join(name
)
51 mustRun(t
, config
.goCmd("build", "-o", outPath
, srcPath(tc
.src
)))
53 cmd
:= hangProneCmd(outPath
)
55 config
.skipIfRuntimeIncompatible(t
)