diff options
author | Rob Pike <r@golang.org> | 2008-06-06 14:27:34 -0700 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2008-06-06 14:27:34 -0700 |
commit | f47dd1a887306dbc45a43701b92a93b9ca3cd10a (patch) | |
tree | 22e573d0f4432512779320404d5df24503fc4919 /test/ken/simpfun.go | |
parent | baa3be75b8d3039bd88eab7951096319655a5d45 (diff) | |
download | golang-f47dd1a887306dbc45a43701b92a93b9ca3cd10a.tar.gz |
add ken's tests.
update run to work with multiple directories
SVN=121485
Diffstat (limited to 'test/ken/simpfun.go')
-rw-r--r-- | test/ken/simpfun.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/ken/simpfun.go b/test/ken/simpfun.go new file mode 100644 index 000000000..3605fa286 --- /dev/null +++ b/test/ken/simpfun.go @@ -0,0 +1,29 @@ +// $G $D/$F.go && $L $F.$A && ./$A.out + +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + + +package main + +func fun(ia,ib,ic int)int; + +func +main() +{ + var x int; + + x = fun(10,20,30); + if x != 60 { panic x; } +} + +func +fun(ia,ib,ic int)int +{ + var o int; + + o = ia+ib+ic; + if o != 60 { panic o; } + return o; +} |