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.
7 // Issue 52788: miscompilation for boolean comparison on ARM64.
16 func f(next func() bool) {
17 for b := next(); b; b = next() {
18 fmt.Printf("next() returned %v\n", b)
23 next := reflect.MakeFunc(reflect.TypeOf((func() bool)(nil)), func(_ []reflect.Value) []reflect.Value {
24 return []reflect.Value{reflect.ValueOf(false)}
26 reflect.ValueOf(f).Call([]reflect.Value{next})