diff options
Diffstat (limited to 'test/escape5.go')
-rw-r--r-- | test/escape5.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/escape5.go b/test/escape5.go index 6b327fe9e..c9646872d 100644 --- a/test/escape5.go +++ b/test/escape5.go @@ -142,3 +142,10 @@ func f9() { var j T1 // ERROR "moved to heap: j" f8(&j) // ERROR "&j escapes to heap" } + +func f10() { + // These don't escape but are too big for the stack + var x [1<<30]byte // ERROR "moved to heap: x" + var y = make([]byte, 1<<30) // ERROR "does not escape" + _ = x[0] + y[0] +} |