From: Lukas Haselsteiner Date: Sun, 6 Jun 2010 21:11:41 +0000 (+0200) Subject: testfaelle fuer gesamt bsp X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=testub10.git;a=commitdiff_plain;h=d3eee741334748ca1cec38587336fced47d7d108 testfaelle fuer gesamt bsp --- diff --git a/gesamt/intelli_00.0 b/gesamt/intelli_00.0 new file mode 100644 index 0000000..1e1e34d --- /dev/null +++ b/gesamt/intelli_00.0 @@ -0,0 +1,7 @@ +method m() + return a(4); +end; + +method a(x) + return this * x; +end; \ No newline at end of file diff --git a/gesamt/intelli_00.call b/gesamt/intelli_00.call new file mode 100644 index 0000000..329ed96 --- /dev/null +++ b/gesamt/intelli_00.call @@ -0,0 +1,3 @@ +extern long long m(long long); + +RET(m(10) == 40); \ No newline at end of file diff --git a/gesamt/intelli_00.instr b/gesamt/intelli_00.instr new file mode 100644 index 0000000..2bd5a0a --- /dev/null +++ b/gesamt/intelli_00.instr @@ -0,0 +1 @@ +22 diff --git a/gesamt/intelli_01.0 b/gesamt/intelli_01.0 new file mode 100644 index 0000000..372f35d --- /dev/null +++ b/gesamt/intelli_01.0 @@ -0,0 +1,7 @@ +method m() + return a(4 - this, (10 * this) - (10 - this)); +end; + +method a(x y) + return x - y - (this * -1); +end; \ No newline at end of file diff --git a/gesamt/intelli_01.call b/gesamt/intelli_01.call new file mode 100644 index 0000000..5c08485 --- /dev/null +++ b/gesamt/intelli_01.call @@ -0,0 +1,7 @@ +extern long long m(long long); + +long t = m(-6); + +//printf("%ld\n", t); + +RET(m(-6) == 80); \ No newline at end of file diff --git a/gesamt/intelli_01.instr b/gesamt/intelli_01.instr new file mode 100644 index 0000000..dde92dd --- /dev/null +++ b/gesamt/intelli_01.instr @@ -0,0 +1 @@ +82 diff --git a/gesamt/intelli_02.0 b/gesamt/intelli_02.0 new file mode 100644 index 0000000..d1d9c86 --- /dev/null +++ b/gesamt/intelli_02.0 @@ -0,0 +1,12 @@ +method m() + var x:= (this - 10).a(10, 5); + /*return x;*/ + var z:= x - a(x, this); + /*return z;*/ + return (x * z) - this; +end; + +method a(x y) + var u := this - x - y; + return u * 2; +end; \ No newline at end of file diff --git a/gesamt/intelli_02.call b/gesamt/intelli_02.call new file mode 100644 index 0000000..58eec6b --- /dev/null +++ b/gesamt/intelli_02.call @@ -0,0 +1,7 @@ +extern long long m(long long); + +long t = m(-50); + +//printf("%ld\n", t); + +RET(t == 67550); \ No newline at end of file diff --git a/gesamt/intelli_02.instr b/gesamt/intelli_02.instr new file mode 100644 index 0000000..d69c74c --- /dev/null +++ b/gesamt/intelli_02.instr @@ -0,0 +1 @@ +73 diff --git a/gesamt/intelli_03.0 b/gesamt/intelli_03.0 new file mode 100644 index 0000000..048e5b3 --- /dev/null +++ b/gesamt/intelli_03.0 @@ -0,0 +1,15 @@ +struct a b c d end; + +method m(ar) + 20 - ar.inc() - 70; + var y := this.b - ar.inc() - (this.inc() * -10) - this.b - ar.b; + return ar.inc() - inc() - (y * -1); +end; + +method inc() + this.a := this.a - -1; + this.b := this.b - -1; + this.c := this.c - -1; + this.d := this.d - -1; + return this.a; +end; \ No newline at end of file diff --git a/gesamt/intelli_03.call b/gesamt/intelli_03.call new file mode 100644 index 0000000..481b9a6 --- /dev/null +++ b/gesamt/intelli_03.call @@ -0,0 +1,10 @@ +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 }; + +long long ret = m(&z1[1], &z2[1]); + +//printf("ret :%ld %ld %ld\n", ret, z1[1], z2[1]); + +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/intelli_03.instr b/gesamt/intelli_03.instr new file mode 100644 index 0000000..cf7ff50 --- /dev/null +++ b/gesamt/intelli_03.instr @@ -0,0 +1 @@ +359