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