aboutsummaryrefslogtreecommitdiff
path: root/test/escape_indir.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2015-02-19 16:27:32 +0300
committerDmitry Vyukov <dvyukov@google.com>2015-03-28 16:15:27 +0000
commitedcc062bdc35a7dd6ac5d33aa85a135b020b72a8 (patch)
treedcf12943f01cb1664af7e009e8403c8fa0875f4b /test/escape_indir.go
parent8a2545744b2662fc34c117e769f3dbd2f7167d19 (diff)
downloadgo-edcc062bdc35a7dd6ac5d33aa85a135b020b72a8.tar.gz
go-edcc062bdc35a7dd6ac5d33aa85a135b020b72a8.zip
test: add tests for escape analysis of interface conversions
The false positives (var incorrectly escapes) are marked with BAD. Change-Id: If64fabb6ea96de44a1177d9ab12e2ccc579fe0c4 Reviewed-on: https://go-review.googlesource.com/5294 Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'test/escape_indir.go')
-rw-r--r--test/escape_indir.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/escape_indir.go b/test/escape_indir.go
index 91aac77d73..7c06ceb5f8 100644
--- a/test/escape_indir.go
+++ b/test/escape_indir.go
@@ -54,14 +54,14 @@ func constptr1() {
i := 0 // ERROR "moved to heap: i"
x := &ConstPtr{} // ERROR "&ConstPtr literal escapes to heap"
x.p = &i // ERROR "&i escapes to heap"
- sink = x
+ sink = x // ERROR "x escapes to heap"
}
func constptr2() {
i := 0 // ERROR "moved to heap: i"
x := &ConstPtr{} // ERROR "&ConstPtr literal does not escape"
x.p = &i // ERROR "&i escapes to heap"
- sink = *x
+ sink = *x// ERROR "\*x escapes to heap"
}
func constptr4() *ConstPtr {