3 // Copyright 2014 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 that code compiles without
8 // "internal error: ... recorded as live on entry" errors
9 // from the liveness code.
11 // This code contains methods or other construct that
12 // trigger the generation of wrapper functions with no
13 // clear line number (they end up using line 1), and those
14 // would have annotations printed if we used -live=1,
15 // like the live.go test does.
16 // Instead, this test relies on the fact that the liveness
17 // analysis turns any non-live parameter on entry into
18 // a compile error. Compiling successfully means that bug
23 // The liveness analysis used to get confused by the tail return
24 // instruction in the wrapper methods generated for T1.M and (*T1).M,
25 // causing a spurious "live at entry: ~r1" for the return result.
36 // Liveness analysis used to have the VARDEFs in the wrong place,
37 // causing a temporary to appear live on entry.
39 func f1(pkg, typ, meth string) {
40 panic("value method " + pkg + "." + typ + "." + meth + " called using nil *" + typ + " pointer")
43 func f2() interface{} {