mirror of
https://github.com/golang/go
synced 2024-11-14 08:10:22 -07:00
729abfa35c
Some tests disabled, some bifurcated into _ssa and not, with appropriate logging added to compiler. "tests/live.go" in particular needs attention. SSA-specific testing removed, since it's all SSA now. Added "-run_skips" option to tests/run.go to simplify checking whether a test still fails (or how it fails) on a skipped platform. The compiler now compiles with SSA by default. If you don't want SSA, specify GOSSAHASH=n (or N) as an environment variable. Function names ending in "_ssa" are always SSA-compiled. GOSSAFUNC=fname retains its "SSA for fname, log to ssa.html" GOSSAPKG=pkg only has an effect when GOSSAHASH=n GOSSAHASH=10101 etc retains its name-hash-matching behavior for purposes of debugging. See #13068 Change-Id: I8217bfeb34173533eaeb391b5f6935483c7d6b43 Reviewed-on: https://go-review.googlesource.com/16299 Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: David Chase <drchase@google.com>
41 lines
931 B
Go
41 lines
931 B
Go
// +build !amd64
|
|
// errorcheck -0 -live -wb=0
|
|
|
|
// Copyright 2014 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// liveness tests with inlining ENABLED
|
|
// see also live.go.
|
|
|
|
package main
|
|
|
|
// issue 8142: lost 'addrtaken' bit on inlined variables.
|
|
// no inlining in this test, so just checking that non-inlined works.
|
|
|
|
func printnl()
|
|
|
|
type T40 struct {
|
|
m map[int]int
|
|
}
|
|
|
|
func newT40() *T40 {
|
|
ret := T40{}
|
|
ret.m = make(map[int]int) // ERROR "live at call to makemap: &ret"
|
|
return &ret
|
|
}
|
|
|
|
func bad40() {
|
|
t := newT40() // ERROR "live at call to makemap: autotmp_.* ret"
|
|
printnl() // ERROR "live at call to printnl: autotmp_.* ret"
|
|
_ = t
|
|
}
|
|
|
|
func good40() {
|
|
ret := T40{}
|
|
ret.m = make(map[int]int) // ERROR "live at call to makemap: autotmp_.* ret"
|
|
t := &ret
|
|
printnl() // ERROR "live at call to printnl: autotmp_.* ret"
|
|
_ = t
|
|
}
|