1// run 2 3// Copyright 2021 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// Issue 44823: miscompilation with store combining. 8 9package main 10 11import "encoding/binary" 12 13//go:noinline 14func Id(a [8]byte) (x [8]byte) { 15 binary.LittleEndian.PutUint64(x[:], binary.LittleEndian.Uint64(a[:])) 16 return 17} 18 19var a = [8]byte{1, 2, 3, 4, 5, 6, 7, 8} 20 21func main() { 22 x := Id(a) 23 if x != a { 24 panic("FAIL") 25 } 26} 27