blob: ef2499194f7add8299c3e8b4a636b765c17acc3f [file] [log] [blame]
Russ Coxd2cc9882012-02-16 23:50:37 -05001// run
Rob Pikeab34d152008-06-06 14:27:34 -07002
3// Copyright 2009 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
Rob Pikeeb37b5b2012-02-24 16:24:24 +11007// Test simple multi-argument multi-valued function.
8
Rob Pikeab34d152008-06-06 14:27:34 -07009package main
10
Rob Pikeab34d152008-06-06 14:27:34 -070011func
Robert Griesemer581530e2009-12-10 12:53:23 -080012main() {
Rob Pikeab34d152008-06-06 14:27:34 -070013 var x,y int;
14
15 x,y = simple(10,20,30);
Rob Pikebc2f5f12008-08-11 22:07:49 -070016 if x+y != 65 { panic(x+y); }
Rob Pikeab34d152008-06-06 14:27:34 -070017}
18
19func
Robert Griesemer581530e2009-12-10 12:53:23 -080020simple(ia,ib,ic int) (oa,ob int) {
Rob Pikeab34d152008-06-06 14:27:34 -070021 return ia+5, ib+ic;
22}