runtime: work around escaping closure in export_test.go
commit572a7a0c0b48c9c7d738364bc7192e9a32276f14
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jan 2018 05:26:29 +0000 (10 05:26 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jan 2018 05:26:29 +0000 (10 05:26 +0000)
treeae7606fee60c2a35f1f871e4356eb9e02c1b4078
parentc8632f7a2cf2e0658a01e1b63061c1e0f630308c
runtime: work around escaping closure in export_test.go

    When compiling runtime, it is not allowed for local variables
    and closures to be heap allocated. In one test, there is a go
    statement with a closure. In the gc compiler, it distinguishes
    capturing variable by value vs. by address, and rewrites it to
    passing the captured values as arguments. Currently we don't
    have this, and the escape analysis decides to heap allocate the
    closure and also the captured variables, which is not allowed.
    Work around it by passing the variables explicitly.

    This is in preparation of turning on escape analysis for the
    runtime.

    Reviewed-on: https://go-review.googlesource.com/86245

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256419 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/go/gofrontend/MERGE
libgo/go/runtime/export_test.go