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
12 func TestTSAN(t
*testing
.T
) {
15 config
:= configure("thread")
16 config
.skipIfCSanitizerBroken(t
)
18 mustRun(t
, config
.goCmd("build", "std"))
28 {src
: "tsan5.go", needsRuntime
: true},
29 {src
: "tsan6.go", needsRuntime
: true},
30 {src
: "tsan7.go", needsRuntime
: true},
33 {src
: "tsan10.go", needsRuntime
: true},
34 {src
: "tsan11.go", needsRuntime
: true},
35 {src
: "tsan12.go", needsRuntime
: true},
37 for _
, tc
:= range cases
{
39 name
:= strings
.TrimSuffix(tc
.src
, ".go")
40 t
.Run(name
, func(t
*testing
.T
) {
44 defer dir
.RemoveAll(t
)
46 outPath
:= dir
.Join(name
)
47 mustRun(t
, config
.goCmd("build", "-o", outPath
, srcPath(tc
.src
)))
49 cmd
:= hangProneCmd(outPath
)
51 config
.skipIfRuntimeIncompatible(t
)