3 // Copyright 2018 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 // This test makes sure that ambiguously live arguments work correctly.
25 // encourage heap object to be collected, and have its finalizer run.
41 func f(s StkObj, b bool) {
48 // use is required here to prevent the conditional
49 // code above from being executed after the first gc() call.
51 // If b==false, h should be collected here.
56 // If b==true, h should be collected here.
65 runtime.SetFinalizer(s.h, func(h *HeapObj) {
66 // Remember at what phase the heap object was collected.
80 runtime.SetFinalizer(s.h, func(h *HeapObj) {
81 // Remember at what phase the heap object was collected.