aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/static-forward-decl-fun.c
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-05-30 11:13:18 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-05-30 11:13:18 +0000
commit109603de14dfe69f3eb9b264a273b38e5684c8de (patch)
treea135a97d949daa7b7da273b2ad7ae0197a867c45 /test/CodeGen/static-forward-decl-fun.c
parentcc9b16394fe6c9245dc4f8661a63d0c3937b62f0 (diff)
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
Diffstat (limited to 'test/CodeGen/static-forward-decl-fun.c')
-rw-r--r--test/CodeGen/static-forward-decl-fun.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/CodeGen/static-forward-decl-fun.c b/test/CodeGen/static-forward-decl-fun.c
new file mode 100644
index 0000000000..636c8fb0d7
--- /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;