blob: 29bf0d58b9725ec787d9ed331f0b1ae83d0e3dfb [file] [log] [blame]
Russ Cox80803842012-02-16 23:49:59 -05001// run
Russ Cox8e996302010-01-18 17:00:38 -08002
3// Copyright 2010 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
7package main
8
9var nf int
10var ng int
11
12func f() (int, int, int) {
13 nf++
14 return 1, 2, 3
15}
16
17func g() int {
18 ng++
19 return 4
20}
21
22var x, y, z = f()
23var m = make(map[int]int)
24var v, ok = m[g()]
25
26func main() {
27 if x != 1 || y != 2 || z != 3 || nf != 1 || v != 0 || ok != false || ng != 1 {
Russ Cox00f9f0c2010-03-30 10:34:57 -070028 println("x=", x, " y=", y, " z=", z, " nf=", nf, " v=", v, " ok=", ok, " ng=", ng)
29 panic("fail")
Russ Cox8e996302010-01-18 17:00:38 -080030 }
31}