Update to go1.25.0
This commit is contained in:
@@ -18,8 +18,27 @@ func zeroSize() {
|
||||
g(&s, 1, 2, 3, 4, 5)
|
||||
|
||||
// amd64:`LEAQ\tcommand-line-arguments\..*\+55\(SP\)`
|
||||
c <- noliteral(struct{}{})
|
||||
}
|
||||
|
||||
// Like zeroSize, but without hiding the zero-sized struct.
|
||||
func zeroSize2() {
|
||||
c := make(chan struct{})
|
||||
// amd64:`MOVQ\t\$0, command-line-arguments\.s\+48\(SP\)`
|
||||
var s *int
|
||||
// force s to be a stack object, also use some (fixed) stack space
|
||||
g(&s, 1, 2, 3, 4, 5)
|
||||
|
||||
// amd64:`LEAQ\tcommand-line-arguments\..*stmp_\d+\(SB\)`
|
||||
c <- struct{}{}
|
||||
}
|
||||
|
||||
//go:noinline
|
||||
func g(**int, int, int, int, int, int) {}
|
||||
|
||||
// noliteral prevents the compiler from recognizing a literal value.
|
||||
//
|
||||
//go:noinline
|
||||
func noliteral[T any](t T) T {
|
||||
return t
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user