1// run 2 3// Copyright 2022 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 52953: miscompilation for composite literal assignment 8// when LHS is address-taken. 9 10package main 11 12type T struct { 13 Field1 bool 14} 15 16func main() { 17 var ret T 18 ret.Field1 = true 19 var v *bool = &ret.Field1 20 ret = T{Field1: *v} 21 check(ret.Field1) 22} 23 24//go:noinline 25func check(b bool) { 26 if !b { 27 panic("FAIL") 28 } 29} 30