diff options
author | Bernhard Schommer <bschommer@users.noreply.github.com> | 2016-06-27 08:02:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-27 08:02:38 -0700 |
commit | 5ceb5de6616178217a589874b26d2046b6cc8c5b (patch) | |
tree | 0c16a6f23605ef16862c8a6ba5d78bebecab16ff /test/regression/krfun.c | |
parent | e005f76f8260fbc3c7d60e4142a55bb5e56cf9b0 (diff) | |
parent | 096a6e38665392d1de16a3059d73ed77e32045a5 (diff) | |
download | compcert-5ceb5de6616178217a589874b26d2046b6cc8c5b.tar.gz compcert-5ceb5de6616178217a589874b26d2046b6cc8c5b.zip |
Merge pull request #103 from AbsInt/KR_fundefs
Revised handling of old-style, K&R function definitions
Diffstat (limited to 'test/regression/krfun.c')
-rw-r--r-- | test/regression/krfun.c | 37 |
1 files changed, 37 insertions, 0 deletions
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; +} + |