Skip to content

Commit b901f97

Browse files
dmitshuryunginnanet
authored andcommitted
test: migrate remaining files to go:build syntax
Most of the test cases in the test directory use the new go:build syntax already. Convert the rest. In general, try to place the build constraint line below the test directive comment in more places. For golang#41184. For golang#60268. Change-Id: I11c41a0642a8a26dc2eda1406da908645bbc005b Cq-Include-Trybots: luci.golang.try:gotip-linux-386-longtest,gotip-linux-amd64-longtest,gotip-windows-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/536236 Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 70a5657 commit b901f97

File tree

127 files changed

+147
-137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+147
-137
lines changed

src/cmd/compile/internal/types2/stdlib_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func firstComment(filename string) (first string) {
191191
}
192192
text = strings.TrimSpace(text[2:])
193193

194-
if strings.HasPrefix(text, "+build ") {
194+
if strings.HasPrefix(text, "go:build ") {
195195
panic("skip")
196196
}
197197
if first == "" {

src/go/types/stdlib_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ func firstComment(filename string) string {
192192
lit = lit[:len(lit)-2]
193193
}
194194
contents := strings.TrimSpace(lit[2:])
195-
if strings.HasPrefix(contents, "+build ") {
195+
if strings.HasPrefix(contents, "go:build ") {
196196
return "skip"
197197
}
198198
if first == "" {

test/abi/bad_internal_offsets.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// compile
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/double_nested_addressed_struct.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/double_nested_struct.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/f_ret_z_not.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/fibish.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/fibish_closure.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/leaf.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/leaf2.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/many_int_input.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/many_intstar_input.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/more_intstar_input.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/named_results.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/named_return_stuff.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/reg_not_ssa.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2023 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/return_stuff.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/s_sif_sif.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/spills3.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/spills4.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/struct_3_string_input.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/struct_lower_1.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/too_big_to_ssa.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/uglyfib.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/abi/wrapdefer_largetmp.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// run
22

33
//go:build !wasm
4-
// +build !wasm
54

65
// Copyright 2021 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/chanlinear.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// +build darwin linux
21
// run
32

3+
//go:build darwin || linux
4+
45
// Copyright 2014 The Go Authors. All rights reserved.
56
// Use of this source code is governed by a BSD-style
67
// license that can be found in the LICENSE file.

test/checkbce.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// +build amd64,!gcflags_noopt
21
// errorcheck -0 -d=ssa/check_bce/debug=3
32

3+
//go:build amd64 && !gcflags_noopt
4+
45
// Copyright 2016 The Go Authors. All rights reserved.
56
// Use of this source code is governed by a BSD-style
67
// license that can be found in the LICENSE file.

test/closure3.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// errorcheckandrundir -0 -m -d=inlfuncswithclosures=1
22

33
//go:build !goexperiment.newinliner
4-
// +build !goexperiment.newinliner
54

65
// Copyright 2017 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/codegen/clobberdead.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// asmcheck -gcflags=-clobberdead
22

3-
// +build amd64 arm64
3+
//go:build amd64 || arm64
44

55
// Copyright 2021 The Go Authors. All rights reserved.
66
// Use of this source code is governed by a BSD-style

test/codegen/clobberdeadreg.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// asmcheck -gcflags=-clobberdeadreg
22

3-
// +build amd64
3+
//go:build amd64
44

55
// Copyright 2021 The Go Authors. All rights reserved.
66
// Use of this source code is governed by a BSD-style

test/codegen/retpoline.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// +build amd64
21
// asmcheck -gcflags=-spectre=ret
32

3+
//go:build amd64
4+
45
package codegen
56

67
func CallFunc(f func()) {

test/codegen/spectre.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// +build amd64
21
// asmcheck -gcflags=-spectre=index
32

3+
//go:build amd64
4+
45
// Copyright 2020 The Go Authors. All rights reserved.
56
// Use of this source code is governed by a BSD-style
67
// license that can be found in the LICENSE file.

test/codegen/structs.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// asmcheck
22

33
//go:build !goexperiment.cgocheck2
4-
// +build !goexperiment.cgocheck2
54

65
// Copyright 2018 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style

test/fixedbugs/bug248.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// +build !nacl,!js,!plan9
21
// errorcheckandrundir -1
32

3+
//go:build !nacl && !js && !plan9
4+
45
// Copyright 2009 The Go Authors. All rights reserved.
56
// Use of this source code is governed by a BSD-style
67
// license that can be found in the LICENSE file.

test/fixedbugs/bug369.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// +build !nacl,!js,!wasip1,gc
21
// run
32

3+
//go:build !nacl && !js && !wasip1 && gc
4+
45
// Copyright 2011 The Go Authors. All rights reserved.
56
// Use of this source code is governed by a BSD-style
67
// license that can be found in the LICENSE file.

test/fixedbugs/bug385_32.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// +build 386 amd64p32 arm
21
// errorcheck
32

3+
//go:build 386 || amd64p32 || arm
4+
45
// Copyright 2011 The Go Authors. All rights reserved.
56
// Use of this source code is governed by a BSD-style
67
// license that can be found in the LICENSE file.

test/fixedbugs/bug385_64.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// +build amd64
21
// errorcheck
32

3+
//go:build amd64
4+
45
// Copyright 2011 The Go Authors. All rights reserved.
56
// Use of this source code is governed by a BSD-style
67
// license that can be found in the LICENSE file.

test/fixedbugs/bug513.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run -race -gcflags=all=-d=checkptr=0
2-
// +build linux,amd64 linux,ppc64le darwin,amd64 freebsd,amd64 netbsd,amd64 windows,amd64
3-
// +build cgo
2+
3+
//go:build ((linux && amd64) || (linux && ppc64le) || (darwin && amd64) || (freebsd && amd64) || (netbsd && amd64) || (windows && amd64)) && cgo
44

55
// Copyright 2021 The Go Authors. All rights reserved.
66
// Use of this source code is governed by a BSD-style

test/fixedbugs/issue10607.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
//go:build linux && !ppc64 && gc && cgo
2-
// +build linux,!ppc64,gc,cgo
3-
41
// run
52

3+
//go:build linux && !ppc64 && gc && cgo
4+
65
// Copyright 2015 The Go Authors. All rights reserved.
76
// Use of this source code is governed by a BSD-style
87
// license that can be found in the LICENSE file.

test/fixedbugs/issue10958.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// +build !nacl,!js,disabled_see_issue_18589
21
// buildrun -t 10 -gcflags=-d=ssa/insert_resched_checks/on,ssa/check/on
32

3+
//go:build !nacl && !js && disabled_see_issue_18589
4+
45
// Copyright 2016 The Go Authors. All rights reserved.
56
// Use of this source code is governed by a BSD-style
67
// license that can be found in the LICENSE file.

test/fixedbugs/issue11326b.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// Does not work with gccgo, which uses a smaller (but still permitted)
44
// exponent size.
5-
// +build !gccgo
5+
//go:build !gccgo
66

77
// Copyright 2015 The Go Authors. All rights reserved.
88
// Use of this source code is governed by a BSD-style

test/fixedbugs/issue11656.dir/asm.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build ppc64 || ppc64le
6-
// +build ppc64 ppc64le
76

87
package main
98

test/fixedbugs/issue11656.dir/asm_generic.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build !ppc64 && !ppc64le
6-
// +build !ppc64,!ppc64le
76

87
package main
98

test/fixedbugs/issue11656.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@
1717
// able to unwind past that point.
1818

1919
//go:build !windows && !wasm && !gccgo
20-
// +build !windows,!wasm,!gccgo
2120

2221
package ignored

test/fixedbugs/issue11771.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// +build !nacl,!js,!wasip1,gc
21
// run
32

3+
//go:build !nacl && !js && !wasip1 && gc
4+
45
// Copyright 2015 The Go Authors. All rights reserved.
56
// Use of this source code is governed by a BSD-style
67
// license that can be found in the LICENSE file.

test/fixedbugs/issue12411.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// +build !386
21
// run
32

3+
//go:build !386
4+
45
// Copyright 2015 The Go Authors. All rights reserved.
56
// Use of this source code is governed by a BSD-style
67
// license that can be found in the LICENSE file.

test/fixedbugs/issue13265.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// errorcheck -0 -race
2-
// +build linux,amd64 linux,ppc64le darwin,amd64 freebsd,amd64 netbsd,amd64 windows,amd64
2+
3+
//go:build (linux && amd64) || (linux && ppc64le) || (darwin && amd64) || (freebsd && amd64) || (netbsd && amd64) || (windows && amd64)
34

45
// Copyright 2017 The Go Authors. All rights reserved.
56
// Use of this source code is governed by a BSD-style

0 commit comments

Comments
 (0)