summaryrefslogtreecommitdiff
path: root/test/ken/simpfun.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2008-06-06 14:27:34 -0700
committerRob Pike <r@golang.org>2008-06-06 14:27:34 -0700
commitf47dd1a887306dbc45a43701b92a93b9ca3cd10a (patch)
tree22e573d0f4432512779320404d5df24503fc4919 /test/ken/simpfun.go
parentbaa3be75b8d3039bd88eab7951096319655a5d45 (diff)
downloadgolang-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.go29
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;
+}