diff options
Diffstat (limited to 'test/regression')
-rw-r--r-- | test/regression/Makefile | 3 | ||||
-rw-r--r-- | test/regression/Results/decl1 | 1 | ||||
-rw-r--r-- | test/regression/decl1.c | 21 |
3 files changed, 24 insertions, 1 deletions
diff --git a/test/regression/Makefile b/test/regression/Makefile index f4f96233..5c601211 100644 --- a/test/regression/Makefile +++ b/test/regression/Makefile @@ -16,7 +16,8 @@ TESTS=int32 int64 floats floats-basics \ expr1 expr6 funptr2 initializers initializers2 initializers3 \ volatile1 volatile2 volatile3 \ funct3 expr5 struct7 struct8 struct11 casts1 casts2 char1 \ - sizeof1 sizeof2 binops bool for1 switch switch2 compound + sizeof1 sizeof2 binops bool for1 switch switch2 compound \ + decl1 # Can run, but only in compiled mode, and have reference output in Results diff --git a/test/regression/Results/decl1 b/test/regression/Results/decl1 new file mode 100644 index 00000000..fa8248b0 --- /dev/null +++ b/test/regression/Results/decl1 @@ -0,0 +1 @@ +Result is 2 diff --git a/test/regression/decl1.c b/test/regression/decl1.c new file mode 100644 index 00000000..6049b4af --- /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); + int f(); + int i; + + p = f; + i = (*p)(1); + printf("Result is %d\n", i); + return 0; +} |