diff options
| author | Hugues Bruant <hugues.bruant@gmail.com> | 2017-10-24 21:57:51 -0700 |
|---|---|---|
| committer | Michael Munday <mike.munday@ibm.com> | 2017-10-30 07:48:21 +0000 |
| commit | 3c46f49f9449eba44eebf318e59f18db79e7bd18 (patch) | |
| tree | 2b2a4a879b1ab14842fb84af02a6326a6f3fc459 /src | |
| parent | eac6fe082ba0e54b387eca7604811958fe62a094 (diff) | |
| download | go-3c46f49f9449eba44eebf318e59f18db79e7bd18.tar.xz | |
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 <mike.munday@ibm.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/compile/internal/gc/asm_test.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/cmd/compile/internal/gc/asm_test.go b/src/cmd/compile/internal/gc/asm_test.go index cdd7c3b735..e661d199d4 100644 --- a/src/cmd/compile/internal/gc/asm_test.go +++ b/src/cmd/compile/internal/gc/asm_test.go @@ -242,7 +242,7 @@ var allAsmTests = []*asmTests{ { arch: "arm", os: "linux", - imports: []string{"math/bits"}, + imports: []string{"math/bits", "runtime"}, tests: linuxARMTests, }, { @@ -1020,12 +1020,11 @@ var linuxAMD64Tests = []*asmTest{ // make sure assembly output has matching offset and base register. fn: ` func f72(a, b int) int { - //go:noinline - func() {_, _ = a, b} () // use some frame + runtime.GC() // use some frame return b } `, - pos: []string{"b\\+40\\(SP\\)"}, + pos: []string{"b\\+24\\(SP\\)"}, }, { // check load combining @@ -1803,8 +1802,7 @@ var linuxARMTests = []*asmTest{ // make sure assembly output has matching offset and base register. fn: ` func f13(a, b int) int { - //go:noinline - func() {_, _ = a, b} () // use some frame + runtime.GC() // use some frame return b } `, |
