3 // Copyright 2015 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 // Test indirection level computation in escape analysis.
14 i := 0 // ERROR "moved to heap: i"
15 p0 := &i // ERROR "moved to heap: p0"
16 p1 := &p0 // ERROR "moved to heap: p1"
17 p2 := &p1 // ERROR "moved to heap: p2"
22 i := 0 // ERROR "moved to heap: i"
23 p0 := &i // ERROR "moved to heap: p0"
24 p1 := &p0 // ERROR "moved to heap: p1"
30 i := 0 // ERROR "moved to heap: i"
31 p0 := &i // ERROR "moved to heap: p0"
38 i := 0 // ERROR "moved to heap: i"
46 i := 0 // ERROR "moved to heap: i"
47 p0 := &i // ERROR "moved to heap: p0"
49 p2 := p1 // ERROR "moved to heap: p2"
54 i := 0 // ERROR "moved to heap: i"
55 p0 := &i // ERROR "moved to heap: p0"
62 i := 0 // ERROR "moved to heap: i"
70 i := 0 // ERROR "moved to heap: i"
74 p2 := *p1 // ERROR "moved to heap: p2"
79 i := 0 // ERROR "moved to heap: i"
91 sink = *p2 // ERROR "\*p2 escapes to heap"
99 sink = *p2 // ERROR "\*p2 escapes to heap"
106 p2 := **p1 // ERROR "moved to heap: p2"