diff options
Diffstat (limited to 'test/live.go')
-rw-r--r-- | test/live.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/live.go b/test/live.go index 9c4e754c1..077a9b676 100644 --- a/test/live.go +++ b/test/live.go @@ -182,3 +182,15 @@ func f12() *int { return nil } } + +// incorrectly placed VARDEF annotations can cause missing liveness annotations. +// this used to be missing the fact that s is live during the call to g13 (because it is +// needed for the call to h13). + +func f13() { + s := "hello" + s = h13(s, g13(s)) // ERROR "live at call to g13: s" +} + +func g13(string) string +func h13(string, string) string |