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// gofrontend miscompiled some cases of append(s, make(typ, ln)...). 8 9package main 10 11var g int 12 13func main() { 14 a := []*int{&g, &g, &g, &g} 15 a = append(a[:0], make([]*int, len(a) - 1)...) 16 if len(a) != 3 || a[0] != nil || a[1] != nil || a[2] != nil { 17 panic(a) 18 } 19} 20