1 // $G $D/$F.go && $L $F.$A && ./$A.out
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 // Check reordering of assignments.
30 func check(x []int, x0, x1, x2 int) {
31 if x[0] != x0 || x[1] != x1 || x[2] != x2 {
32 fmt.Printf("%v, want %d,%d,%d\n", x, x0, x1, x2)
37 func check3(x, y, z, xx, yy, zz int) {
38 if x != xx || y != yy || z != zz {
39 fmt.Printf("%d,%d,%d, want %d,%d,%d\n", x, y, z, xx, yy, zz)
64 x[1], y[0] = f(0), f(1)
72 x[1], y[0] = gx[0], gx[1]
92 check3(x, y, z, 2, 1, 3)
95 func f1(x, y, z int) (xx, yy, zz int) {
99 func f2() (x, y, z int) {
105 check3(x, y, z, 2, 1, 3)
114 panic("not panicking")
120 i, x[i], x[5] = 1, 100, 500