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 29402: wrong optimization of comparison of 8// constant and shift on MIPS. 9 10package main 11 12//go:noinline 13func F(s []int) bool { 14 half := len(s) / 2 15 return half >= 0 16} 17 18func main() { 19 b := F([]int{1, 2, 3, 4}) 20 if !b { 21 panic("FAIL") 22 } 23} 24