Source file test/codegen/issue20859.go

     1  // asmcheck
     2  
     3  // Copyright 2026 The Go Authors. All rights reserved.
     4  // Use of this source code is governed by a BSD-style
     5  // license that can be found in the LICENSE file.
     6  
     7  package codegen
     8  
     9  //go:noinline
    10  func use16(b []byte, x uint64) {
    11  	b[0] = byte(x)
    12  }
    13  
    14  //go:noinline
    15  func resultSlotArray(x uint64) [16]byte {
    16  	var ret [16]byte
    17  	// amd64:-`.*\.ret\+`
    18  	use16(ret[:8], x)
    19  	// amd64:-`.*\.ret\+`
    20  	use16(ret[8:], x)
    21  	// amd64:-`.*\.ret\+` -`.*MOVUPS.*~r0`
    22  	return ret
    23  }
    24  
    25  //go:noinline
    26  func resultSlotArrayMultipleReturns(x uint64, c bool) [16]byte {
    27  	var ret [16]byte
    28  	// amd64:-`.*\.ret\+`
    29  	use16(ret[:8], x)
    30  	if c {
    31  		// amd64:-`.*\.ret\+` -`.*MOVUPS.*~r0`
    32  		return ret
    33  	}
    34  	// amd64:-`.*\.ret\+`
    35  	use16(ret[8:], x)
    36  	// amd64:-`.*\.ret\+` -`.*MOVUPS.*~r0`
    37  	return ret
    38  }
    39  
    40  //go:noinline
    41  func resultSlotPartialReturn(x uint64, c bool) [16]byte {
    42  	var ret [16]byte
    43  	// amd64:-`.*\.ret\+`
    44  	use16(ret[:8], x)
    45  	if c {
    46  		// amd64:-`.*\.ret\+` -`.*MOVUPS.*~r0`
    47  		return ret
    48  	}
    49  	return [16]byte{1}
    50  }
    51  
    52  //go:noinline
    53  func resultSlotPartialReturnLocal(x uint64, c bool) [16]byte {
    54  	var ret [16]byte
    55  	// amd64:-`.*\.ret\+`
    56  	use16(ret[:8], x)
    57  	if c {
    58  		// amd64:-`.*\.ret\+` -`.*MOVUPS.*~r0`
    59  		return ret
    60  	}
    61  	other := [16]byte{1}
    62  	return other
    63  }
    64  

View as plain text