]> Cypherpunks repositories - gostls13.git/commitdiff
bug 100 - spurious return warnings
authorRuss Cox <rsc@golang.org>
Fri, 12 Sep 2008 15:37:08 +0000 (08:37 -0700)
committerRuss Cox <rsc@golang.org>
Fri, 12 Sep 2008 15:37:08 +0000 (08:37 -0700)
R=r
OCL=15221
CL=15221

test/bugs/bug100.go [new file with mode: 0644]

diff --git a/test/bugs/bug100.go b/test/bugs/bug100.go
new file mode 100644 (file)
index 0000000..99c4484
--- /dev/null
@@ -0,0 +1,27 @@
+// 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.
+
+// $G $D/$F.go || (echo BUG: should compile cleanly; exit 1)
+package main
+
+func f() int {
+       i := 0
+       for {
+               if i >= sys.argc() {
+                       return i
+               }
+               i++
+       }
+}
+
+func g() int {
+       for {
+       }
+}
+
+func h() int {
+       for {
+               return 1
+       }
+}