aboutsummaryrefslogtreecommitdiffstats
path: root/test/regression/decl1.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2014-11-26 15:50:36 +0100
committerXavier Leroy <xavier.leroy@inria.fr>2014-11-26 15:50:36 +0100
commitc3b615f875ed2cf8418453c79c4621d2dc61b0a0 (patch)
tree8e125450f2313e35d36618ac8c1dfca62688afc3 /test/regression/decl1.c
parent1ccc058794381d7d7c2ff704786009019489001d (diff)
downloadcompcert-c3b615f875ed2cf8418453c79c4621d2dc61b0a0.tar.gz
compcert-c3b615f875ed2cf8418453c79c4621d2dc61b0a0.zip
Wrong handling of block-local function declarations (in Elab.ml).
Diffstat (limited to 'test/regression/decl1.c')
-rw-r--r--test/regression/decl1.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/regression/decl1.c b/test/regression/decl1.c
new file mode 100644
index 00000000..d2aedba7
--- /dev/null
+++ b/test/regression/decl1.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+
+/* Local function declarations */
+
+int f (int p)
+{
+ p = p + 1;
+ return p;
+}
+
+int main (int argc, char **argv)
+{
+ int (*p)();
+ int f();
+ int i;
+
+ p = f;
+ i = (*p)(1);
+ printf("Result is %d\n", i);
+ return 0;
+}