Source file test/fixedbugs/issue23545.go
1 // run 2 3 // Copyright 2018 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 23545: gccgo didn't lower array comparison to 8 // proper equality function in some case. 9 10 package main 11 12 func main() { 13 if a := Get(); a != dummyID(1234) { 14 panic("FAIL") 15 } 16 } 17 18 func dummyID(x int) [Size]interface{} { 19 var out [Size]interface{} 20 out[0] = x 21 return out 22 } 23 24 const Size = 32 25 26 type OutputID [Size]interface{} 27 28 //go:noinline 29 func Get() OutputID { 30 return dummyID(1234) 31 } 32