From 93ee438ea843a39de25259c94f2a80e338774db4 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Mon, 7 Jun 2010 13:20:32 +0200 Subject: [PATCH] gesamt: paramcheck und instr update --- gesamt/georg_fib_101.instr | 2 +- gesamt/georg_fib_102.instr | 2 +- gesamt/georg_fib_121.instr | 2 +- gesamt/georg_fib_122.instr | 2 +- gesamt/intelli_00.instr | 2 +- gesamt/intelli_01.instr | 2 +- gesamt/intelli_02.instr | 2 +- gesamt/intelli_03.call | 10 +++++++++- gesamt/lewurm_00.instr | 2 +- gesamt/lewurm_01.instr | 2 +- gesamt/lewurm_02.instr | 2 +- gesamt/lewurm_03.instr | 2 +- gesamt/lewurm_04.instr | 2 +- gesamt/lewurm_05.0 | 31 +++++++++++++++++++++++++++++++ gesamt/lewurm_05.call | 21 +++++++++++++++++++++ gesamt/lewurm_05.instr | 1 + gesamt/lewurm_06.0 | 7 +++++++ gesamt/lewurm_06.call | 13 +++++++++++++ gesamt/lewurm_06.instr | 1 + 19 files changed, 95 insertions(+), 13 deletions(-) create mode 100644 gesamt/lewurm_05.0 create mode 100644 gesamt/lewurm_05.call create mode 100644 gesamt/lewurm_05.instr create mode 100644 gesamt/lewurm_06.0 create mode 100644 gesamt/lewurm_06.call create mode 100644 gesamt/lewurm_06.instr diff --git a/gesamt/georg_fib_101.instr b/gesamt/georg_fib_101.instr index bb06e56..328e4ce 100644 --- a/gesamt/georg_fib_101.instr +++ b/gesamt/georg_fib_101.instr @@ -1 +1 @@ -4134 +3694 diff --git a/gesamt/georg_fib_102.instr b/gesamt/georg_fib_102.instr index bb06e56..328e4ce 100644 --- a/gesamt/georg_fib_102.instr +++ b/gesamt/georg_fib_102.instr @@ -1 +1 @@ -4134 +3694 diff --git a/gesamt/georg_fib_121.instr b/gesamt/georg_fib_121.instr index 7b690e2..bb06e56 100644 --- a/gesamt/georg_fib_121.instr +++ b/gesamt/georg_fib_121.instr @@ -1 +1 @@ -4574 +4134 diff --git a/gesamt/georg_fib_122.instr b/gesamt/georg_fib_122.instr index 7b690e2..bb06e56 100644 --- a/gesamt/georg_fib_122.instr +++ b/gesamt/georg_fib_122.instr @@ -1 +1 @@ -4574 +4134 diff --git a/gesamt/intelli_00.instr b/gesamt/intelli_00.instr index 2bd5a0a..b6a7d89 100644 --- a/gesamt/intelli_00.instr +++ b/gesamt/intelli_00.instr @@ -1 +1 @@ -22 +16 diff --git a/gesamt/intelli_01.instr b/gesamt/intelli_01.instr index dde92dd..fb1e7bc 100644 --- a/gesamt/intelli_01.instr +++ b/gesamt/intelli_01.instr @@ -1 +1 @@ -82 +54 diff --git a/gesamt/intelli_02.instr b/gesamt/intelli_02.instr index d69c74c..a8fa06e 100644 --- a/gesamt/intelli_02.instr +++ b/gesamt/intelli_02.instr @@ -1 +1 @@ -73 +62 diff --git a/gesamt/intelli_03.call b/gesamt/intelli_03.call index 481b9a6..e18ae40 100644 --- a/gesamt/intelli_03.call +++ b/gesamt/intelli_03.call @@ -2,9 +2,17 @@ extern long long m(long long* ar1, long long *ar2); long long z1[] = { 0, 2, 4, 6, 8, 10, 12 }; long long z2[] = { 10, 20, 40, 60, 80, 100, 120 }; +int i; + +for(i=0; i < sizeof z1/sizeof z1[0]; i++) { + printf("z1[%i]: %ld, z2[%i]: %ld\n", i, z1[i], i, z2[i]); +} long long ret = m(&z1[1], &z2[1]); +printf("ret: %ld\n", ret); -//printf("ret :%ld %ld %ld\n", ret, z1[1], z2[1]); +for(i=0; i < sizeof z1/sizeof z1[0]; i++) { + printf("z1[%i]: %ld, z2[%i]: %ld\n", i, z1[i], i, z2[i]); +} RET(ret == -16 && z1[0] == 0 && z2[0] == 10 && z1[1] == 4 && z1[2] == 6 && z1[3] == 8 && z1[4] == 10 && z1[5] == 10 && z1[6] == 12 && z2[1] == 23 && z2[2] == 43 && z2[3] == 63 && z2[4] == 83 && z2[5] == 100 && z2[6] == 120); \ No newline at end of file diff --git a/gesamt/lewurm_00.instr b/gesamt/lewurm_00.instr index b4de394..48082f7 100644 --- a/gesamt/lewurm_00.instr +++ b/gesamt/lewurm_00.instr @@ -1 +1 @@ -11 +12 diff --git a/gesamt/lewurm_01.instr b/gesamt/lewurm_01.instr index a45fd52..7273c0f 100644 --- a/gesamt/lewurm_01.instr +++ b/gesamt/lewurm_01.instr @@ -1 +1 @@ -24 +25 diff --git a/gesamt/lewurm_02.instr b/gesamt/lewurm_02.instr index e522732..a272009 100644 --- a/gesamt/lewurm_02.instr +++ b/gesamt/lewurm_02.instr @@ -1 +1 @@ -38 +39 diff --git a/gesamt/lewurm_03.instr b/gesamt/lewurm_03.instr index 8351c19..60d3b2f 100644 --- a/gesamt/lewurm_03.instr +++ b/gesamt/lewurm_03.instr @@ -1 +1 @@ -14 +15 diff --git a/gesamt/lewurm_04.instr b/gesamt/lewurm_04.instr index 5bc6609..52bd8e4 100644 --- a/gesamt/lewurm_04.instr +++ b/gesamt/lewurm_04.instr @@ -1 +1 @@ -117 +120 diff --git a/gesamt/lewurm_05.0 b/gesamt/lewurm_05.0 new file mode 100644 index 0000000..125197b --- /dev/null +++ b/gesamt/lewurm_05.0 @@ -0,0 +1,31 @@ +method fa(a b c d) + return g(a, b, c, d); +end; +method fa_(a b c d) + return g(a, b, c, d,); +end; + +method fb(a b c d) + return g(b, c, d, a); +end; +method fb_(a b c d) + return g(b, c, d, a,); +end; + +method fc(a b c d) + return g(c, d, a, b); +end; +method fc_(a b c d) + return g(c, d, a, b,); +end; + +method fd(a b c d) + return g(d, a, b, c); +end; +method fd_(a b c d) + return g(d, a, b, c,); +end; + +method g(a b c d) + return a; +end; diff --git a/gesamt/lewurm_05.call b/gesamt/lewurm_05.call new file mode 100644 index 0000000..0db317d --- /dev/null +++ b/gesamt/lewurm_05.call @@ -0,0 +1,21 @@ +long fa (long, long, long, long, long); +long fa_(long, long, long, long, long); +long fb (long, long, long, long, long); +long fb_(long, long, long, long, long); +long fc (long, long, long, long, long); +long fc_(long, long, long, long, long); +long fd (long, long, long, long, long); +long fd_(long, long, long, long, long); + +long (*fp[])(long, long, long, long, long) = {fa, fa_, fb, fb_, fc, fc_, fd, fd_}; +char st[sizeof fp/sizeof fp[0]][4] = {"fa ", "fa_", "fb ", "fb_", "fc ", "fc_", "fd ", "fd_"}; + +#define PAR(a) ((a-'a'+1)*10) +int i, t, r = 1; + +for(i=0; i < sizeof fp/sizeof fp[0]; i++) { + t = fp[i](0xdead, PAR('a'), PAR('b'), PAR('c'), PAR('d')); + printf("returnwert von %s() ist %3i (erwartet: %3i)\n", st[i], t, PAR(st[i][1])); + r = r && (t==PAR(st[i][1])); +} +RET(r); diff --git a/gesamt/lewurm_05.instr b/gesamt/lewurm_05.instr new file mode 100644 index 0000000..de8febe --- /dev/null +++ b/gesamt/lewurm_05.instr @@ -0,0 +1 @@ +168 diff --git a/gesamt/lewurm_06.0 b/gesamt/lewurm_06.0 new file mode 100644 index 0000000..4f6220a --- /dev/null +++ b/gesamt/lewurm_06.0 @@ -0,0 +1,7 @@ +method f() + return (this-1).g(this-5, this-10); +end; + +method g(a b) + return this-a-b; +end; diff --git a/gesamt/lewurm_06.call b/gesamt/lewurm_06.call new file mode 100644 index 0000000..e65a81c --- /dev/null +++ b/gesamt/lewurm_06.call @@ -0,0 +1,13 @@ +long f(long); +long g(long, long, long); +#define ERG(a) ((a-1)-(a-5)-(a-10)) +#define ARG1 -10 +#define ARG2 1333157 +#define ARG3 -35981341 +int ret1 = f(ARG1); +int ret2 = f(ARG2); +int ret3 = f(ARG3); +printf("ret1 ist %8i (sollte %8i sein)\n", ret1, ERG(ARG1)); +printf("ret2 ist %8i (sollte %8i sein)\n", ret2, ERG(ARG2)); +printf("ret3 ist %8i (sollte %8i sein)\n", ret3, ERG(ARG3)); +RET(ret1 == ERG(ARG1) && ret2 == ERG(ARG2) && ret3 == ERG(ARG3)); diff --git a/gesamt/lewurm_06.instr b/gesamt/lewurm_06.instr new file mode 100644 index 0000000..d88e313 --- /dev/null +++ b/gesamt/lewurm_06.instr @@ -0,0 +1 @@ +81 -- 2.25.1