]> Cypherpunks.ru repositories - gostls13.git/blobdiff - test/escape_calls.go
cmd/compile/internal/inline: score call sites exposed by inlines
[gostls13.git] / test / escape_calls.go
index 20cb6433346f748643245067b5f5cb6457154cd3..aa7c7f516cf96ef38dc7ab1b8617e7cbf5b246e7 100644 (file)
@@ -11,7 +11,7 @@
 
 package foo
 
-func f(buf []byte) []byte { // ERROR "leaking param: buf to result ~r1 level=0$"
+func f(buf []byte) []byte { // ERROR "leaking param: buf to result ~r0 level=0$"
        return buf
 }
 
@@ -19,7 +19,7 @@ func g(*byte) string
 
 func h(e int) {
        var x [32]byte // ERROR "moved to heap: x$"
-       g(&f(x[:])[0]) // ERROR "&f\(x\[:\]\)\[0\] escapes to heap$" "x escapes to heap$"
+       g(&f(x[:])[0])
 }
 
 type Node struct {
@@ -33,10 +33,10 @@ func walk(np **Node) int { // ERROR "leaking param content: np"
        if n == nil {
                return 0
        }
-       wl := walk(&n.left)  // ERROR "walk &n.left does not escape"
-       wr := walk(&n.right) // ERROR "walk &n.right does not escape"
+       wl := walk(&n.left)
+       wr := walk(&n.right)
        if wl < wr {
-               n.left, n.right = n.right, n.left
+               n.left, n.right = n.right, n.left // ERROR "ignoring self-assignment"
                wl, wr = wr, wl
        }
        *np = n
@@ -44,11 +44,11 @@ func walk(np **Node) int { // ERROR "leaking param content: np"
 }
 
 // Test for bug where func var f used prototype's escape analysis results.
-func prototype(xyz []string) {} // ERROR "prototype xyz does not escape"
+func prototype(xyz []string) {} // ERROR "xyz does not escape"
 func bar() {
        var got [][]string
        f := prototype
        f = func(ss []string) { got = append(got, ss) } // ERROR "leaking param: ss" "func literal does not escape"
        s := "string"
-       f([]string{s}) // ERROR "\[\]string literal escapes to heap"
+       f([]string{s}) // ERROR "\[\]string{...} escapes to heap"
 }