]> Cypherpunks.ru repositories - gostls13.git/blobdiff - test/escape_indir.go
cmd/compile/internal/inline: score call sites exposed by inlines
[gostls13.git] / test / escape_indir.go
index 19889f259f8cd199af0cb08c71083cb4f5c758ad..12005e35f9f12e9a8a559fe83b0dc0f765f33805 100644 (file)
@@ -23,7 +23,7 @@ type ConstPtr2 struct {
 
 func constptr0() {
        i := 0           // ERROR "moved to heap: i"
-       x := &ConstPtr{} // ERROR "&ConstPtr literal does not escape"
+       x := &ConstPtr{} // ERROR "&ConstPtr{} does not escape"
        // BAD: i should not escape here
        x.p = &i
        _ = x
@@ -31,55 +31,55 @@ func constptr0() {
 
 func constptr01() *ConstPtr {
        i := 0           // ERROR "moved to heap: i"
-       x := &ConstPtr{} // ERROR "&ConstPtr literal escapes to heap"
+       x := &ConstPtr{} // ERROR "&ConstPtr{} escapes to heap"
        x.p = &i
        return x
 }
 
 func constptr02() ConstPtr {
        i := 0           // ERROR "moved to heap: i"
-       x := &ConstPtr{} // ERROR "&ConstPtr literal does not escape"
+       x := &ConstPtr{} // ERROR "&ConstPtr{} does not escape"
        x.p = &i
        return *x
 }
 
 func constptr03() **ConstPtr {
        i := 0           // ERROR "moved to heap: i"
-       x := &ConstPtr{} // ERROR "&ConstPtr literal escapes to heap" "moved to heap: x"
+       x := &ConstPtr{} // ERROR "&ConstPtr{} escapes to heap" "moved to heap: x"
        x.p = &i
        return &x
 }
 
 func constptr1() {
        i := 0           // ERROR "moved to heap: i"
-       x := &ConstPtr{} // ERROR "&ConstPtr literal escapes to heap"
+       x := &ConstPtr{} // ERROR "&ConstPtr{} escapes to heap"
        x.p = &i
        sink = x
 }
 
 func constptr2() {
        i := 0           // ERROR "moved to heap: i"
-       x := &ConstPtr{} // ERROR "&ConstPtr literal does not escape"
+       x := &ConstPtr{} // ERROR "&ConstPtr{} does not escape"
        x.p = &i
-       sink = *x        // ERROR "\*x escapes to heap"
+       sink = *x // ERROR "\*x escapes to heap"
 }
 
 func constptr4() *ConstPtr {
        p := new(ConstPtr) // ERROR "new\(ConstPtr\) escapes to heap"
-       *p = *&ConstPtr{}  // ERROR "&ConstPtr literal does not escape"
+       *p = *&ConstPtr{}  // ERROR "&ConstPtr{} does not escape"
        return p
 }
 
 func constptr5() *ConstPtr {
        p := new(ConstPtr) // ERROR "new\(ConstPtr\) escapes to heap"
-       p1 := &ConstPtr{}  // ERROR "&ConstPtr literal does not escape"
+       p1 := &ConstPtr{}  // ERROR "&ConstPtr{} does not escape"
        *p = *p1
        return p
 }
 
 // BAD: p should not escape here
 func constptr6(p *ConstPtr) { // ERROR "leaking param content: p"
-       p1 := &ConstPtr{} // ERROR "&ConstPtr literal does not escape"
+       p1 := &ConstPtr{} // ERROR "&ConstPtr{} does not escape"
        *p1 = *p
        _ = p1
 }
@@ -102,17 +102,17 @@ func constptr8() *ConstPtr {
 func constptr9() ConstPtr {
        p := new(ConstPtr) // ERROR "new\(ConstPtr\) does not escape"
        var p1 ConstPtr2
-       i := 0    // ERROR "moved to heap: i"
+       i := 0 // ERROR "moved to heap: i"
        p1.p = &i
        p.c = p1
        return *p
 }
 
 func constptr10() ConstPtr {
-       x := &ConstPtr{} // ERROR "moved to heap: x" "&ConstPtr literal escapes to heap"
+       x := &ConstPtr{} // ERROR "moved to heap: x" "&ConstPtr{} escapes to heap"
        i := 0           // ERROR "moved to heap: i"
        var p *ConstPtr
-       p = &ConstPtr{p: &i, x: &x} // ERROR "&ConstPtr literal does not escape"
+       p = &ConstPtr{p: &i, x: &x} // ERROR "&ConstPtr{...} does not escape"
        var pp **ConstPtr
        pp = &p
        return **pp
@@ -121,7 +121,7 @@ func constptr10() ConstPtr {
 func constptr11() *ConstPtr {
        i := 0             // ERROR "moved to heap: i"
        p := new(ConstPtr) // ERROR "new\(ConstPtr\) escapes to heap"
-       p1 := &ConstPtr{}  // ERROR "&ConstPtr literal does not escape"
+       p1 := &ConstPtr{}  // ERROR "&ConstPtr{} does not escape"
        p1.p = &i
        *p = *p1
        return p
@@ -134,7 +134,7 @@ func foo(p **int) { // ERROR "p does not escape"
 }
 
 func foo1(p *int) { // ERROR "p does not escape"
-       i := 0  // ERROR "moved to heap: i"
+       i := 0 // ERROR "moved to heap: i"
        y := &p
        *y = &i
 }
@@ -148,13 +148,13 @@ func foo2() {
        var z Z
        z.f = &x
        p := z.f
-       i := 0  // ERROR "moved to heap: i"
+       i := 0 // ERROR "moved to heap: i"
        *p = &i
 }
 
 var global *byte
 
 func f() {
-       var x byte    // ERROR "moved to heap: x"
+       var x byte // ERROR "moved to heap: x"
        global = &*&x
 }