3 // Copyright 2023 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.
7 // Test the 'for range' construct ranging over integers.
14 for i := range int(4) {
16 println("range var", i, "want", j)
22 println("wrong count ranging over 4:", j)
35 println("range var", i, "want", j)
41 println("wrong count ranging over 4:", j)
53 for i := range MyInt(4) {
55 println("range var", i, "want", j)
61 println("wrong count ranging over 4:", j)
73 panic("must not be executed")