3 // Copyright 2016 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file.
7 // issue 16515: spilled Duff-adjusted address may be invalid
13 type T [62]int // DUFFZERO with non-zero adjustment on AMD64
19 // Two DUFFZEROs on the same address with a function call in between.
20 // Duff-adjusted address will be spilled and loaded
25 g() // call a function with large frame, trigger a stack move
26 *x = T{} // DUFFZERO again
30 // a function with large frame
37 var s struct { a T; b [8192-62]int } // allocate 64K, hopefully it's in a new span and a few bytes before it is garbage
38 sink = &s // force heap allocation
42 println("s.a[0] =", s.a[0])
43 panic("zeroing failed")
50 println("a[0] =", a[0])
51 panic("zeroing failed")