Source file test/abi/result_live.go

     1  // errorcheck -0 -live
     2  
     3  // Copyright 2021 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.
     6  
     7  package p
     8  
     9  type T struct { a, b, c, d string } // pass in registers, not SSA-able
    10  
    11  //go:registerparams
    12  func F() (r T) {
    13  	r.a = g(1) // ERROR "live at call to g: r"
    14  	r.b = g(2) // ERROR "live at call to g: r"
    15  	r.c = g(3) // ERROR "live at call to g: r"
    16  	r.d = g(4) // ERROR "live at call to g: r"
    17  	return
    18  }
    19  
    20  func g(int) string
    21  

View as plain text