1// run 2 3//go:build !wasm 4 5// Copyright 2021 The Go Authors. All rights reserved. 6// Use of this source code is governed by a BSD-style 7// license that can be found in the LICENSE file. 8 9// wasm is excluded because the compiler chatter about register abi pragma ends up 10// on stdout, and causes the expected output to not match. 11 12package main 13 14import "fmt" 15 16type Z struct { 17} 18 19type NZ struct { 20 x, y int 21} 22 23//go:noinline 24func f(x, y int) (Z, NZ, Z) { 25 var z Z 26 return z, NZ{x, y}, z 27} 28 29//go:noinline 30func g() (Z, NZ, Z) { 31 a, b, c := f(3, 4) 32 return c, b, a 33} 34 35func main() { 36 _, b, _ := g() 37 fmt.Println(b.x + b.y) 38} 39