2021-02-26 15:37:26 -07:00
|
|
|
// run
|
|
|
|
|
2021-02-24 10:58:01 -07:00
|
|
|
//go:build !wasm
|
|
|
|
|
2021-02-26 15:37:26 -07:00
|
|
|
// Copyright 2021 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.
|
|
|
|
|
2021-02-24 10:58:01 -07:00
|
|
|
// wasm is excluded because the compiler chatter about register abi pragma ends up
|
|
|
|
// on stdout, and causes the expected output to not match.
|
|
|
|
|
2021-02-26 15:37:26 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
type Z struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
type NZ struct {
|
|
|
|
x, y int
|
|
|
|
}
|
|
|
|
|
|
|
|
//go:noinline
|
2021-02-19 15:11:40 -07:00
|
|
|
func f(x, y int) (Z, NZ, Z) {
|
2021-02-26 15:37:26 -07:00
|
|
|
var z Z
|
2021-02-19 15:11:40 -07:00
|
|
|
return z, NZ{x, y}, z
|
2021-02-26 15:37:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
//go:noinline
|
2021-02-19 15:11:40 -07:00
|
|
|
func g() (Z, NZ, Z) {
|
|
|
|
a, b, c := f(3, 4)
|
|
|
|
return c, b, a
|
2021-02-26 15:37:26 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
2021-02-19 15:11:40 -07:00
|
|
|
_, b, _ := g()
|
|
|
|
fmt.Println(b.x + b.y)
|
2021-02-26 15:37:26 -07:00
|
|
|
}
|