summaryrefslogtreecommitdiff
path: root/test/escape2.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-08-28 23:29:34 -0400
committerRuss Cox <rsc@golang.org>2011-08-28 23:29:34 -0400
commit1ac5ae46674b9380e458f4039e8cf0f9eaea4fc6 (patch)
tree3664e452ac6709fa61b7546625377945e5ce5632 /test/escape2.go
parent576dfab047620a20a5ecbc474f0dcd6877e07ef5 (diff)
downloadgo-1ac5ae46674b9380e458f4039e8cf0f9eaea4fc6.tar.gz
gc: fix arm build
Escape analysis was incorrectly assuming that functions without bodies don't leak their parameters. This meant that sync/atomic's TestAddInt64 was allocating x on its stack, and then x was not properly aligned for use with the atomic 64-bit instructions. Obviously we should figure out the alignment story on 5g too, but this fix is correct and should restore the build to 'ok'. TBR=lvd CC=golang-dev http://codereview.appspot.com/4964047
Diffstat (limited to 'test/escape2.go')
-rw-r--r--test/escape2.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/escape2.go b/test/escape2.go
index 24a88f751..0b78624b6 100644
--- a/test/escape2.go
+++ b/test/escape2.go
@@ -774,3 +774,9 @@ func foo118(unknown func(*int)) { // ERROR "unknown does not escape"
x := 1 // ERROR "moved to heap: NAME-x"
unknown(&x) // ERROR "&x escapes to heap"
}
+
+func external(*int)
+
+func foo119(x *int) { // ERROR "leaking param: NAME-x"
+ external(x)
+}