diff options
Diffstat (limited to 'test/regression')
-rw-r--r-- | test/regression/Makefile | 2 | ||||
-rw-r--r-- | test/regression/Results/krfun | 3 | ||||
-rw-r--r-- | test/regression/krfun.c | 37 |
3 files changed, 41 insertions, 1 deletions
diff --git a/test/regression/Makefile b/test/regression/Makefile index 6ef44b78..335a136b 100644 --- a/test/regression/Makefile +++ b/test/regression/Makefile @@ -18,7 +18,7 @@ TESTS=int32 int64 floats floats-basics \ funct3 expr5 struct7 struct8 struct11 struct12 casts1 casts2 char1 \ sizeof1 sizeof2 binops bool for1 switch switch2 compound \ decl1 interop1 bitfields9 ptrs3 \ - parsing + parsing krfun # Can run, but only in compiled mode, and have reference output in Results diff --git a/test/regression/Results/krfun b/test/regression/Results/krfun new file mode 100644 index 00000000..7e2320b2 --- /dev/null +++ b/test/regression/Results/krfun @@ -0,0 +1,3 @@ +f(1, "Hello", 2) +g(1, "World", 0x1.921fb6p+1, 0x1.921fb5452455p+1, -34, 12345678901234567) +h(6, "warning!", 7) diff --git a/test/regression/krfun.c b/test/regression/krfun.c new file mode 100644 index 00000000..e34098b5 --- /dev/null +++ b/test/regression/krfun.c @@ -0,0 +1,37 @@ +/* Old-style, K&R function definitions */ + +#include <stdio.h> + +void f(a, b, c) + int c, a; + char * b; +{ + printf("f(%d, \"%s\", %d)\n", a, b, c); +} + +void g(a, b, c, d, e, x) + const unsigned char a; + char b[64]; + float c; + double d; + volatile int e; + long long x; +{ + printf("g(%d, \"%s\", %a, %a, %d, %lld)\n", a, b, c, d, e, x); +} + +void h(a, b, c) + char * b; +{ + printf("h(%d, \"%s\", %d)\n", a, b, c); +} + + +int main() +{ + f(1, "Hello", 2); + g(257, "World", 3.141592654, 3.141592654, -34, 12345678901234567LL); + h(6, "warning!", 7); + return 0; +} + |