Source file test/fixedbugs/issue53653.go

     1  // run
     2  
     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.
     6  
     7  package main
     8  
     9  import "math"
    10  
    11  func main() {
    12  	f()
    13  	g()
    14  	h()
    15  }
    16  func f() {
    17  	for i := int64(math.MinInt64); i >= math.MinInt64; i-- {
    18  		if i > 0 {
    19  			println("done")
    20  			return
    21  		}
    22  		println(i, i > 0)
    23  	}
    24  }
    25  func g() {
    26  	for i := int64(math.MinInt64) + 1; i >= math.MinInt64; i-- {
    27  		if i > 0 {
    28  			println("done")
    29  			return
    30  		}
    31  		println(i, i > 0)
    32  	}
    33  }
    34  func h() {
    35  	for i := int64(math.MinInt64) + 2; i >= math.MinInt64; i -= 2 {
    36  		if i > 0 {
    37  			println("done")
    38  			return
    39  		}
    40  		println(i, i > 0)
    41  	}
    42  }
    43  

View as plain text