Source file test/fixedbugs/issue26116.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  package main
     8  
     9  func main() {
    10  	s := []int{0, 1, 2}
    11  	i := 1
    12  	for i > 0 && s[i] != 2 {
    13  		i++
    14  	}
    15  	if i != 2 {
    16  		panic("loop didn't run")
    17  	}
    18  }
    19  

View as plain text