Skip to content

Commit 3c46f49

Browse files
huguesbmundaym
authored andcommitted
cmd/compile: fix incorrect go:noinline usage
This pragma is not actually honored by the compiler. The tests implicitly relied on the inliner being unable to inline closures with captured variables, which will soon change. Fixes #22208 Change-Id: I13abc9c930b9156d43ec216f8efb768952a29439 Reviewed-on: https://go-review.googlesource.com/73211 Reviewed-by: Michael Munday <[email protected]>
1 parent eac6fe0 commit 3c46f49

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/cmd/compile/internal/gc/asm_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ var allAsmTests = []*asmTests{
242242
{
243243
arch: "arm",
244244
os: "linux",
245-
imports: []string{"math/bits"},
245+
imports: []string{"math/bits", "runtime"},
246246
tests: linuxARMTests,
247247
},
248248
{
@@ -1020,12 +1020,11 @@ var linuxAMD64Tests = []*asmTest{
10201020
// make sure assembly output has matching offset and base register.
10211021
fn: `
10221022
func f72(a, b int) int {
1023-
//go:noinline
1024-
func() {_, _ = a, b} () // use some frame
1023+
runtime.GC() // use some frame
10251024
return b
10261025
}
10271026
`,
1028-
pos: []string{"b\\+40\\(SP\\)"},
1027+
pos: []string{"b\\+24\\(SP\\)"},
10291028
},
10301029
{
10311030
// check load combining
@@ -1803,8 +1802,7 @@ var linuxARMTests = []*asmTest{
18031802
// make sure assembly output has matching offset and base register.
18041803
fn: `
18051804
func f13(a, b int) int {
1806-
//go:noinline
1807-
func() {_, _ = a, b} () // use some frame
1805+
runtime.GC() // use some frame
18081806
return b
18091807
}
18101808
`,

0 commit comments

Comments
 (0)