Source file test/codegen/issue77375.go

     1  // asmcheck
     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 codegen
     8  
     9  func Range(n int) []int {
    10  	m := make([]int, n)
    11  
    12  	for i := 0; i < n; i++ {
    13  		m[i] = i
    14  	}
    15  
    16  	for i := range n {
    17  		m[i] = i
    18  	}
    19  
    20  	for i := range len(m) {
    21  		m[i] = i
    22  	}
    23  
    24  	for i := range m {
    25  		m[i] = i
    26  	}
    27  
    28  	return m
    29  }
    30  
    31  func F(size int) {
    32  	// amd64:-`.*panicBounds`
    33  	// arm64:-`.*panicBounds`
    34  	Range(size)
    35  }
    36  
    37  func main() {
    38  	F(-1)
    39  }
    40  

View as plain text