3 // Copyright 2011 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 reordering of assignments.
31 func check(x []int, x0, x1, x2 int) {
32 if x[0] != x0 || x[1] != x1 || x[2] != x2 {
33 fmt.Printf("%v, want %d,%d,%d\n", x, x0, x1, x2)
38 func check3(x, y, z, xx, yy, zz int) {
39 if x != xx || y != yy || z != zz {
40 fmt.Printf("%d,%d,%d, want %d,%d,%d\n", x, y, z, xx, yy, zz)
65 x[1], y[0] = f(0), f(1)
73 x[1], y[0] = gx[0], gx[1]
93 check3(x, y, z, 2, 1, 3)
96 func f1(x, y, z int) (xx, yy, zz int) {
100 func f2() (x, y, z int) {
106 check3(x, y, z, 2, 1, 3)
115 panic("not panicking")
121 i, x[i], x[5] = 1, 100, 500
125 m := make(map[int]int)