gc: diagnose init loop involving func

Fixes #2295.

R=ken2
CC=golang-dev
https://golang.org/cl/5655057
diff --git a/test/fixedbugs/bug413.go b/test/fixedbugs/bug413.go
new file mode 100644
index 0000000..32b7efc
--- /dev/null
+++ b/test/fixedbugs/bug413.go
@@ -0,0 +1,11 @@
+// errchk $G $D/$F.go
+
+// Copyright 2012 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 p
+
+func f(i int) int { return i }
+
+var i = func() int {a := f(i); return a}()  // ERROR "initialization loop"
\ No newline at end of file