Source file test/fixedbugs/issue78892.go

     1  // run
     2  
     3  // Copyright 2026 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 f(x int) int {
    10          if x == 1 {
    11                  return 7
    12          }
    13          return 7 / (x - 1)
    14  }
    15  
    16  //go:noinline
    17  func g(x int) int {
    18  	r := 0
    19  	for range 5 {
    20  		r += f(x)
    21  	}
    22  	return r
    23  }
    24  
    25  func main() {
    26  	g(1)
    27  }
    28  

View as plain text