2021-02-26 22:37:26 +00:00
|
|
|
// run
|
|
|
|
|
2021-02-24 17:58:01 +00:00
|
|
|
//go:build !wasm
|
|
|
|
// +build !wasm
|
|
|
|
|
2021-02-26 22:37:26 +00: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 17:58:01 +00: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 22:37:26 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
type Z struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
type NZ struct {
|
|
|
|
x, y int
|
|
|
|
}
|
|
|
|
|
|
|
|
//go:noinline
|
2021-02-19 22:11:40 +00:00
|
|
|
func f(x, y int) (Z, NZ, Z) {
|
2021-02-26 22:37:26 +00:00
|
|
|
var z Z
|
2021-02-19 22:11:40 +00:00
|
|
|
return z, NZ{x, y}, z
|
2021-02-26 22:37:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//go:noinline
|
2021-02-19 22:11:40 +00:00
|
|
|
func g() (Z, NZ, Z) {
|
|
|
|
a, b, c := f(3, 4)
|
|
|
|
return c, b, a
|
2021-02-26 22:37:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
2021-02-19 22:11:40 +00:00
|
|
|
_, b, _ := g()
|
|
|
|
fmt.Println(b.x + b.y)
|
2021-02-26 22:37:26 +00:00
|
|
|
}
|