Always check that the definition of a function has the correct type.  
This fixes a crash on the included testcase (found in NetHack).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51767 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGen/static-forward-decl-fun.c b/test/CodeGen/static-forward-decl-fun.c
new file mode 100644
index 0000000..636c8fb
--- /dev/null
+++ b/test/CodeGen/static-forward-decl-fun.c
@@ -0,0 +1,6 @@
+// RUN: clang %s -emit-llvm
+
+static int staticfun(void);
+int (*staticuse1)(void) = staticfun;
+static int staticfun() {return 1;}
+int (*staticuse2)(void) = staticfun;