mirror of
https://github.com/golang/go
synced 2024-09-04 23:44:16 +00:00
![David Chase](/assets/img/avatar_default.png)
Repair of CL 300749. ALSO: found evidence that stack maps for bodyless methods are wrong. gofmt in test/abi removed never-executed code in types/size.go Updates #44816. Updates #40724. Change-Id: Ifeb5fee60f60e7c7b58ee0457f58a3265d6cf3f6 Reviewed-on: https://go-review.googlesource.com/c/go/+/302071 Trust: David Chase <drchase@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
45 lines
769 B
Go
45 lines
769 B
Go
// run
|
|
|
|
//go:build !wasm
|
|
// +build !wasm
|
|
|
|
// 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.
|
|
|
|
// wasm is excluded because the compiler chatter about register abi pragma ends up
|
|
// on stdout, and causes the expected output to not match.
|
|
|
|
package main
|
|
|
|
import "fmt"
|
|
|
|
type i5f5 struct {
|
|
a, b int16
|
|
c, d, e int32
|
|
r, s, t, u, v float32
|
|
}
|
|
|
|
//go:noinline
|
|
func spills(_ *float32) {
|
|
|
|
}
|
|
|
|
//go:registerparams
|
|
//go:noinline
|
|
func F(x i5f5) i5f5 {
|
|
y := x.v
|
|
spills(&y)
|
|
x.r = y
|
|
return x
|
|
}
|
|
|
|
func main() {
|
|
x := i5f5{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
|
|
y := x
|
|
z := F(x)
|
|
if (i5f5{1, 2, 3, 4, 5, 10, 7, 8, 9, 10}) != z {
|
|
fmt.Printf("y=%v, z=%v\n", y, z)
|
|
}
|
|
}
|