ppc: testfaelle fuer ppc32 'portiert'
authorBernhard Urban <lewurm@gmail.com>
Wed, 9 Jun 2010 18:45:39 +0000 (20:45 +0200)
committerBernhard Urban <lewurm@gmail.com>
Wed, 9 Jun 2010 18:45:39 +0000 (20:45 +0200)
193 files changed:
codeb/georg_fib_000.call
codeb/georg_fib_020.call
gesamt/codea_abgabe_aq.0
gesamt/codeb_abgabe_ba.call
gesamt/codeb_abgabe_bj.0
gesamt/codeb_abgabe_bj.call
gesamt/intelli_00.0
gesamt/intelli_00.call
gesamt/intelli_01.call
gesamt/intelli_02.call
gesamt/intelli_03.call
gesamt/lewurm_04.0
gesamt/lewurm_09.0
gesamt/lewurm_09.call
gesamt_ppc/codea_abgabe_a.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_a.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_a.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_aa.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_aa.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_aa.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ab.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ab.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ab.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ac.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ac.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ac.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ad.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ad.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ad.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ae.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ae.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ae.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_af.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_af.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_af.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ag.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ag.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ag.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ah.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ah.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ah.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ai.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ai.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ai.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_aj.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_aj.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_aj.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ak.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ak.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ak.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_al.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_al.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_al.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_am.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_am.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_am.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_an.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_an.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_an.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ao.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ao.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ao.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ap.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ap.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ap.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_aq.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_aq.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_aq.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ar.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ar.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ar.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_as.0 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_as.call [new file with mode: 0644]
gesamt_ppc/codea_abgabe_as.instr [new file with mode: 0644]
gesamt_ppc/codea_abgabe_x0.1 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_x1.1 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_x2.1 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_x3.1 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_y0.2 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_y1.2 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_y2.2 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_y3.2 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_y4.2 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_y5.2 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_y6.2 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_y7.2 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_y8.2 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_y9.2 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_z0.3 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_za.3 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_zb.3 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_zc.3 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_zd.3 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_ze.3 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_zf.3 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_zg.3 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_zh.3 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_zi.3 [new file with mode: 0644]
gesamt_ppc/codea_abgabe_zj.3 [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_ba.0 [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_ba.call [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_ba.instr [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bb.0 [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bb.call [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bb.instr [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bc.0 [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bc.call [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bc.instr [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bd.0 [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bd.call [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bd.instr [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_be.0 [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_be.call [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_be.instr [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bf.0 [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bf.call [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bf.instr [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bg.0 [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bg.call [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bg.instr [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bh.0 [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bh.call [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bh.instr [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bi.0 [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bi.call [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bi.instr [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bj.0 [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bj.call [new file with mode: 0644]
gesamt_ppc/codeb_abgabe_bj.instr [new file with mode: 0644]
gesamt_ppc/georg_fib_000.call [new symlink]
gesamt_ppc/georg_fib_020.call [new symlink]
gesamt_ppc/georg_fib_100.call [new symlink]
gesamt_ppc/georg_fib_101.0 [new file with mode: 0644]
gesamt_ppc/georg_fib_101.call [new symlink]
gesamt_ppc/georg_fib_101.instr [new file with mode: 0644]
gesamt_ppc/georg_fib_102.0 [new file with mode: 0644]
gesamt_ppc/georg_fib_102.call [new symlink]
gesamt_ppc/georg_fib_102.instr [new file with mode: 0644]
gesamt_ppc/georg_fib_120.call [new symlink]
gesamt_ppc/georg_fib_121.0 [new file with mode: 0644]
gesamt_ppc/georg_fib_121.call [new symlink]
gesamt_ppc/georg_fib_121.instr [new file with mode: 0644]
gesamt_ppc/georg_fib_122.0 [new file with mode: 0644]
gesamt_ppc/georg_fib_122.call [new symlink]
gesamt_ppc/georg_fib_122.instr [new file with mode: 0644]
gesamt_ppc/intelli_00.0 [new file with mode: 0644]
gesamt_ppc/intelli_00.call [new file with mode: 0644]
gesamt_ppc/intelli_00.instr [new file with mode: 0644]
gesamt_ppc/intelli_01.0 [new file with mode: 0644]
gesamt_ppc/intelli_01.call [new file with mode: 0644]
gesamt_ppc/intelli_01.instr [new file with mode: 0644]
gesamt_ppc/intelli_02.0 [new file with mode: 0644]
gesamt_ppc/intelli_02.call [new file with mode: 0644]
gesamt_ppc/intelli_02.instr [new file with mode: 0644]
gesamt_ppc/intelli_03.0 [new file with mode: 0644]
gesamt_ppc/intelli_03.call [new file with mode: 0644]
gesamt_ppc/intelli_03.instr [new file with mode: 0644]
gesamt_ppc/lewurm_00.0 [new file with mode: 0644]
gesamt_ppc/lewurm_00.call [new file with mode: 0644]
gesamt_ppc/lewurm_00.instr [new file with mode: 0644]
gesamt_ppc/lewurm_01.0 [new file with mode: 0644]
gesamt_ppc/lewurm_01.call [new file with mode: 0644]
gesamt_ppc/lewurm_01.instr [new file with mode: 0644]
gesamt_ppc/lewurm_02.0 [new file with mode: 0644]
gesamt_ppc/lewurm_02.call [new file with mode: 0644]
gesamt_ppc/lewurm_02.instr [new file with mode: 0644]
gesamt_ppc/lewurm_03.0 [new file with mode: 0644]
gesamt_ppc/lewurm_03.call [new file with mode: 0644]
gesamt_ppc/lewurm_03.instr [new file with mode: 0644]
gesamt_ppc/lewurm_04.0 [new file with mode: 0644]
gesamt_ppc/lewurm_04.call [new file with mode: 0644]
gesamt_ppc/lewurm_04.instr [new file with mode: 0644]
gesamt_ppc/lewurm_05.0 [new file with mode: 0644]
gesamt_ppc/lewurm_05.call [new file with mode: 0644]
gesamt_ppc/lewurm_05.instr [new file with mode: 0644]
gesamt_ppc/lewurm_06.0 [new file with mode: 0644]
gesamt_ppc/lewurm_06.call [new file with mode: 0644]
gesamt_ppc/lewurm_06.instr [new file with mode: 0644]
gesamt_ppc/lewurm_07.0 [new file with mode: 0644]
gesamt_ppc/lewurm_07.call [new file with mode: 0644]
gesamt_ppc/lewurm_07.instr [new file with mode: 0644]
gesamt_ppc/lewurm_08.0 [new file with mode: 0644]
gesamt_ppc/lewurm_08.call [new file with mode: 0644]
gesamt_ppc/lewurm_08.instr [new file with mode: 0644]
gesamt_ppc/lewurm_09.0 [new file with mode: 0644]
gesamt_ppc/lewurm_09.call [new file with mode: 0644]
gesamt_ppc/lewurm_09.instr [new file with mode: 0644]
scripts/callingconvention.c [new file with mode: 0644]
scripts/callingconvention.o
scripts/modlvatest_gesamt.sh
scripts/modlvatest_gesamt_ppc.sh [new file with mode: 0755]
scripts/onetest_gesamt
scripts/onetest_gesamt_ppc [new file with mode: 0755]

index e04b8656c9534e7aa66c039d6fc6750fa0b76847..bc21f4eadafbabfdfe4d22c7c2b2600d9db09c13 100644 (file)
@@ -1,2 +1,2 @@
-extern long fib(long);
+extern int fib(int);
 RET(fib(-1)==-1 && fib(0)==0 && fib(1)==1 && fib(2)==1 && fib(3)==2 && fib(7)+fib(8)==fib(9));
index dbf1d12444fabdab21b98a6dcf5130288511da2f..200b29c8ccf46490ffeb24c06a9a4ae448c017ca 100644 (file)
@@ -1,2 +1,2 @@
-extern long fib(long,long);
+extern int fib(int,int);
 RET(fib(0,-1)==-1 && fib(0,0)==0 && fib(0,1)==1 && fib(0,2)==1 && fib(0,3)==2 && fib(0,7)+fib(0,8)==fib(0,9));
index 6f1010868e0daf5272d58c6e70998b32d7015296..f41a469a5cf005b7e67353805c73093f7f677acd 100644 (file)
@@ -1,5 +1,5 @@
 struct a b c end;
 
 method m(x)
-  return (this-8).c;
+  return (this-4).c;
 end;
index 12cbab0c2314742afbb03b560a4a00058de3a8b0..e3f3c99226ea3e8ce70905be81fa2df857821acd 100644 (file)
@@ -1,2 +1,5 @@
 extern long m(long,long);
-RET(m(7,4)==6 && m(18,22)==-8);
+int r1 = m(7,4);
+int r2 = m(18,22);
+printf("r1: %d\nr2: %d\n", r1, r2);
+RET(r1==6 && r2==-8);
index b49c7c88eaa465a3792639353baff24d4bd861fb..427e7dea9ec11211c578dd2779cee11ed025538d 100644 (file)
@@ -3,7 +3,7 @@ struct elem end;
 method vadd(v n)
   while 0<n do
     n:=n-1;
-    (this-(-8*n)).elem := (this-(n*-8)).elem - (0-(v-(n*-8)).elem);
+    (this-(-4*n)).elem := (this-(n*-4)).elem - (0-(v-(n*-4)).elem);
   end;
   return this;
 end;
index 7e14f34fbc0f70b33864b9539fa1b6c48f69313b..2dd64d2ab8f2100162c0f6c216423db92cdc9c06 100644 (file)
@@ -1,6 +1,14 @@
 extern long *vadd(long *, long *, long);
 long a[]={7,11,13};
 long b[]={23,42,5};
-RET(a==vadd(a,b,2) &&
+int i;
+for(i=0; i<3; i++) {
+       printf("a[%i]: %d, b[%i]: %d\n", i, a[i], i, b[i]);
+}
+int ret = vadd(a,b,2)==a;
+for(i=0; i<3; i++) {
+       printf("a[%i]: %d, b[%i]: %d\n", i, a[i], i, b[i]);
+}
+RET(ret &&
     a[0]==30 && a[1]==53 && a[2]==13 &&
     b[0]==23 && b[1]==42 && b[2]==5);
index 1e1e34d3b753919bfad081925752422490ca8384..9ebd9925022d881372a851a665aefa32ea776b6e 100644 (file)
@@ -4,4 +4,4 @@ end;
 
 method a(x)
        return this * x;
-end;
\ No newline at end of file
+end;
index 329ed963860a8cb0ec8d0f871c2f4397817445f2..42806e9e7b7ef68545a6fd541e42483c2865f93f 100644 (file)
@@ -1,3 +1,3 @@
-extern long long m(long long);
-
-RET(m(10) == 40);
\ No newline at end of file
+extern int m(int);
+int ret = m(10);
+RET(ret == 40);
index 5c084851990cfbf61e4053be046016c0668241e7..6593e3591c0e0d346c4f859bc71916a408081391 100644 (file)
@@ -1,7 +1,7 @@
-extern long long m(long long);
+extern int m(int);
 
-long t = m(-6);
+int t = m(-6);
 
-//printf("%ld\n", t);
+//printf("%d\n", t);
 
-RET(m(-6) == 80);
\ No newline at end of file
+RET(m(-6) == 80);
index 58eec6bd39830ff33efeafd38d973c048291e461..03aac0ee0753becb80a6cbc2416b769e3b841d07 100644 (file)
@@ -1,7 +1,7 @@
-extern long long m(long long);
+extern int m(int);
 
-long t = m(-50);
+int t = m(-50);
 
-//printf("%ld\n", t);
+//printf("%d\n", t);
 
-RET(t == 67550);
\ No newline at end of file
+RET(t == 67550);
index 10c438748a906a7f3141a345ea434397c14f16f5..5a280cd3b4cdb4b323fc780e746b0931efb7fd13 100644 (file)
@@ -1,18 +1,18 @@
-extern long long m(long long* ar1, long long *ar2);
+extern int m(int* ar1, int *ar2);
 
-long long z1[] = { 0, 2, 4, 6, 8, 10, 12 };
-long long z2[] = { 10, 20, 40, 60, 80, 100, 120 };
+int z1[] = { 0, 2, 4, 6, 8, 10, 12 };
+int 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]);
+       printf("z1[%i]: %d, z2[%i]: %d\n", i, z1[i], i, z2[i]);
 }
 
-long long ret = m(&z1[1], &z2[1]);
-printf("ret: %ld\n", ret);
+int ret = m(&z1[1], &z2[1]);
+printf("ret: %d\n", ret);
 
 for(i=0; i < sizeof z1/sizeof z1[0]; i++) {
-       printf("z1[%i]: %ld, z2[%i]: %ld\n", i, z1[i], i, z2[i]);
+       printf("z1[%i]: %d, z2[%i]: %d\n", i, z1[i], i, z2[i]);
 }
 printf("anmerkung: dieser testfall ist von seiteneffekten gepraegt\n"
        "es *koennte* passieren, dass der testfall richtig ist obwohl er\n"
index 16d1ddae289cb8a8abf809224f6a5c2b98d021a3..3cb87cba48892f2589064acd695a86d5c6c2fca9 100644 (file)
@@ -1,4 +1,5 @@
 method f()
+                       /* 14 */      /* 16 */ /* 15 */
        return (this-1).g()-(this-2).g()-g();
 end;
 
index 58e31db667a04dc889f679996a1e03a5477547b7..bba113f6299eb582a81ad9750d0e22adb22ff9ec 100644 (file)
@@ -1,20 +1,20 @@
 /* inspired by s'evil skinn0rEE ! */
 struct a end;
 method f()
-       return ((this--8).g()).h(j());
+       return ((this--4).g()).h(j());
 end;
 
 method g()
        this.a := this.a*10;
-       return this--8;
+       return this--4;
 end;
 
 method h()
        this.a := this.a*20;
-       return this--8;
+       return this--4;
 end;
 
 method j()
        this.a := this.a*30;
-       return this--8;
+       return this--4;
 end;
index 80343ce1e14459cf7adaabda083f6a12a962e079..db132e610436c955ccc03924eccf5f9f8db0a73f 100644 (file)
@@ -1,20 +1,20 @@
-unsigned long long f(unsigned long long[]);
+unsigned int f(unsigned int[]);
 
 /* hint: pointer arithmetic in C */
 #define ERG (ar + 3)
 
-unsigned long long ar[] = {5, 6, 7};
-unsigned long long ar_copy[] = {5, 6, 7};
+unsigned int ar[] = {5, 6, 7};
+unsigned int ar_copy[] = {5, 6, 7};
 int j;
-unsigned long long ret;
+unsigned int ret;
 
-printf("adr of ar: 0x%016lx\n", ar);
+printf("adr of ar: 0x%08lx\n", ar);
 for(j=0; j < sizeof ar / sizeof ar[0]; j++) {
        printf("ar[%i]: %d\n", j, ar[j]);
 }
 ret = f(ar);
-printf("ret ist 0x%016lx (sollte 0x%016lx sein)\n", ret, ERG);
+printf("ret ist 0x%08lx (sollte 0x%08lx sein)\n", ret, ERG);
 for(j=0; j < sizeof ar / sizeof ar[0]; j++) {
        printf("ar[%i]: %d\n", j, ar[j]);
 }
-RET(ret == (unsigned long long) ERG && ar[0] == ar_copy[0] * 30 && ar[1] == ar_copy[1] * 10 && ar[2] == ar_copy[2] * 20);
+RET(ret == (unsigned int) ERG && ar[0] == ar_copy[0] * 30 && ar[1] == ar_copy[1] * 10 && ar[2] == ar_copy[2] * 20);
diff --git a/gesamt_ppc/codea_abgabe_a.0 b/gesamt_ppc/codea_abgabe_a.0
new file mode 100644 (file)
index 0000000..8c3fc2a
--- /dev/null
@@ -0,0 +1,3 @@
+method m(x)
+  return x-this;
+end;
diff --git a/gesamt_ppc/codea_abgabe_a.call b/gesamt_ppc/codea_abgabe_a.call
new file mode 100644 (file)
index 0000000..dfe2827
--- /dev/null
@@ -0,0 +1,2 @@
+extern long m(long,long);
+RET(m(2,5)==3 && m(7,2)==-5);
diff --git a/gesamt_ppc/codea_abgabe_a.instr b/gesamt_ppc/codea_abgabe_a.instr
new file mode 100644 (file)
index 0000000..1e8b314
--- /dev/null
@@ -0,0 +1 @@
+6
diff --git a/gesamt_ppc/codea_abgabe_aa.0 b/gesamt_ppc/codea_abgabe_aa.0
new file mode 100644 (file)
index 0000000..3ef30f4
--- /dev/null
@@ -0,0 +1,3 @@
+method m()
+  return this;
+end;
diff --git a/gesamt_ppc/codea_abgabe_aa.call b/gesamt_ppc/codea_abgabe_aa.call
new file mode 100644 (file)
index 0000000..84b8a6d
--- /dev/null
@@ -0,0 +1,2 @@
+extern long m(long);
+RET(m(5)==5 && m(9)==9);
diff --git a/gesamt_ppc/codea_abgabe_aa.instr b/gesamt_ppc/codea_abgabe_aa.instr
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/gesamt_ppc/codea_abgabe_ab.0 b/gesamt_ppc/codea_abgabe_ab.0
new file mode 100644 (file)
index 0000000..930c6b4
--- /dev/null
@@ -0,0 +1,3 @@
+method m(x y z)
+  return z;
+end;
diff --git a/gesamt_ppc/codea_abgabe_ab.call b/gesamt_ppc/codea_abgabe_ab.call
new file mode 100644 (file)
index 0000000..73ec7db
--- /dev/null
@@ -0,0 +1,2 @@
+extern long m(long,long,long,long);
+RET(m(1,2,3,5)==5 && m(3,2,1,9)==9);
diff --git a/gesamt_ppc/codea_abgabe_ab.instr b/gesamt_ppc/codea_abgabe_ab.instr
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/gesamt_ppc/codea_abgabe_ac.0 b/gesamt_ppc/codea_abgabe_ac.0
new file mode 100644 (file)
index 0000000..245811f
--- /dev/null
@@ -0,0 +1,3 @@
+method m(x)
+  return not this;
+end;
diff --git a/gesamt_ppc/codea_abgabe_ac.call b/gesamt_ppc/codea_abgabe_ac.call
new file mode 100644 (file)
index 0000000..3a00483
--- /dev/null
@@ -0,0 +1,2 @@
+extern long m(long,long);
+RET(m(0,12)==1 && m(9,13)==0);
diff --git a/gesamt_ppc/codea_abgabe_ac.instr b/gesamt_ppc/codea_abgabe_ac.instr
new file mode 100644 (file)
index 0000000..45a4fb7
--- /dev/null
@@ -0,0 +1 @@
+8
diff --git a/gesamt_ppc/codea_abgabe_ad.0 b/gesamt_ppc/codea_abgabe_ad.0
new file mode 100644 (file)
index 0000000..dd86b6e
--- /dev/null
@@ -0,0 +1,3 @@
+method m(x)
+  return -5;
+end;
diff --git a/gesamt_ppc/codea_abgabe_ad.call b/gesamt_ppc/codea_abgabe_ad.call
new file mode 100644 (file)
index 0000000..e341dfc
--- /dev/null
@@ -0,0 +1,2 @@
+extern long m(long,long);
+RET(m(0,12)==-5 && m(9,13)==-5);
diff --git a/gesamt_ppc/codea_abgabe_ad.instr b/gesamt_ppc/codea_abgabe_ad.instr
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/gesamt_ppc/codea_abgabe_ae.0 b/gesamt_ppc/codea_abgabe_ae.0
new file mode 100644 (file)
index 0000000..380147c
--- /dev/null
@@ -0,0 +1,3 @@
+method m(x)
+  return x--3;
+end;
diff --git a/gesamt_ppc/codea_abgabe_ae.call b/gesamt_ppc/codea_abgabe_ae.call
new file mode 100644 (file)
index 0000000..248ce1c
--- /dev/null
@@ -0,0 +1,2 @@
+extern long m(long,long);
+RET(m(0,12)==15 && m(9,13)==16);
diff --git a/gesamt_ppc/codea_abgabe_ae.instr b/gesamt_ppc/codea_abgabe_ae.instr
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/gesamt_ppc/codea_abgabe_af.0 b/gesamt_ppc/codea_abgabe_af.0
new file mode 100644 (file)
index 0000000..500f66a
--- /dev/null
@@ -0,0 +1,3 @@
+method m(x)
+  return x*this*x*this;
+end;
diff --git a/gesamt_ppc/codea_abgabe_af.call b/gesamt_ppc/codea_abgabe_af.call
new file mode 100644 (file)
index 0000000..94f6da0
--- /dev/null
@@ -0,0 +1,2 @@
+extern long m(long,long);
+RET(m(2,3)==36 && m(5,-7)==35*35);
diff --git a/gesamt_ppc/codea_abgabe_af.instr b/gesamt_ppc/codea_abgabe_af.instr
new file mode 100644 (file)
index 0000000..f599e28
--- /dev/null
@@ -0,0 +1 @@
+10
diff --git a/gesamt_ppc/codea_abgabe_ag.0 b/gesamt_ppc/codea_abgabe_ag.0
new file mode 100644 (file)
index 0000000..3d524dd
--- /dev/null
@@ -0,0 +1,3 @@
+method m(x)
+  return this or x;
+end;
diff --git a/gesamt_ppc/codea_abgabe_ag.call b/gesamt_ppc/codea_abgabe_ag.call
new file mode 100644 (file)
index 0000000..85b9ba2
--- /dev/null
@@ -0,0 +1,2 @@
+extern long m(long,long);
+RET(m(3,9)==11 && m(6,13)==15);
diff --git a/gesamt_ppc/codea_abgabe_ag.instr b/gesamt_ppc/codea_abgabe_ag.instr
new file mode 100644 (file)
index 0000000..1e8b314
--- /dev/null
@@ -0,0 +1 @@
+6
diff --git a/gesamt_ppc/codea_abgabe_ah.0 b/gesamt_ppc/codea_abgabe_ah.0
new file mode 100644 (file)
index 0000000..970e37c
--- /dev/null
@@ -0,0 +1,3 @@
+method m(x)
+  return x<this;
+end;
diff --git a/gesamt_ppc/codea_abgabe_ah.call b/gesamt_ppc/codea_abgabe_ah.call
new file mode 100644 (file)
index 0000000..4698fe9
--- /dev/null
@@ -0,0 +1,2 @@
+extern long m(long,long);
+RET(m(3,3)==0 && m(3,2)==1 && m(2,3)==0);
diff --git a/gesamt_ppc/codea_abgabe_ah.instr b/gesamt_ppc/codea_abgabe_ah.instr
new file mode 100644 (file)
index 0000000..48082f7
--- /dev/null
@@ -0,0 +1 @@
+12
diff --git a/gesamt_ppc/codea_abgabe_ai.0 b/gesamt_ppc/codea_abgabe_ai.0
new file mode 100644 (file)
index 0000000..1fc75db
--- /dev/null
@@ -0,0 +1,3 @@
+method m(x)
+  return -4<x;
+end;
diff --git a/gesamt_ppc/codea_abgabe_ai.call b/gesamt_ppc/codea_abgabe_ai.call
new file mode 100644 (file)
index 0000000..08f6d30
--- /dev/null
@@ -0,0 +1,2 @@
+extern long m(long,long);
+RET(m(0,-4)==0 && m(9,-3)==1);
diff --git a/gesamt_ppc/codea_abgabe_ai.instr b/gesamt_ppc/codea_abgabe_ai.instr
new file mode 100644 (file)
index 0000000..45a4fb7
--- /dev/null
@@ -0,0 +1 @@
+8
diff --git a/gesamt_ppc/codea_abgabe_aj.0 b/gesamt_ppc/codea_abgabe_aj.0
new file mode 100644 (file)
index 0000000..6d89eca
--- /dev/null
@@ -0,0 +1,3 @@
+method m(x)
+  return this<-9;
+end;
diff --git a/gesamt_ppc/codea_abgabe_aj.call b/gesamt_ppc/codea_abgabe_aj.call
new file mode 100644 (file)
index 0000000..f0e4c7b
--- /dev/null
@@ -0,0 +1,2 @@
+extern long m(long,long);
+RET(m(-9,12)==0 && m(-10,13)==1);
diff --git a/gesamt_ppc/codea_abgabe_aj.instr b/gesamt_ppc/codea_abgabe_aj.instr
new file mode 100644 (file)
index 0000000..45a4fb7
--- /dev/null
@@ -0,0 +1 @@
+8
diff --git a/gesamt_ppc/codea_abgabe_ak.0 b/gesamt_ppc/codea_abgabe_ak.0
new file mode 100644 (file)
index 0000000..e28cfcd
--- /dev/null
@@ -0,0 +1,3 @@
+method m(x)
+  return 3=x;
+end;
diff --git a/gesamt_ppc/codea_abgabe_ak.call b/gesamt_ppc/codea_abgabe_ak.call
new file mode 100644 (file)
index 0000000..471bd6a
--- /dev/null
@@ -0,0 +1,2 @@
+extern long m(long,long);
+RET(m(0,3)==1 && m(9,13)==0);
diff --git a/gesamt_ppc/codea_abgabe_ak.instr b/gesamt_ppc/codea_abgabe_ak.instr
new file mode 100644 (file)
index 0000000..45a4fb7
--- /dev/null
@@ -0,0 +1 @@
+8
diff --git a/gesamt_ppc/codea_abgabe_al.0 b/gesamt_ppc/codea_abgabe_al.0
new file mode 100644 (file)
index 0000000..950703a
--- /dev/null
@@ -0,0 +1,6 @@
+struct a b c end;
+struct d e f end;
+
+method m(x)
+  return e;
+end;
diff --git a/gesamt_ppc/codea_abgabe_al.call b/gesamt_ppc/codea_abgabe_al.call
new file mode 100644 (file)
index 0000000..d1c4997
--- /dev/null
@@ -0,0 +1,3 @@
+long s[]={12,23,34,45,53,61};
+extern long m(long *,long);
+RET(m(s,12)==23 && m(s+3,13)==53);
diff --git a/gesamt_ppc/codea_abgabe_al.instr b/gesamt_ppc/codea_abgabe_al.instr
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/gesamt_ppc/codea_abgabe_am.0 b/gesamt_ppc/codea_abgabe_am.0
new file mode 100644 (file)
index 0000000..786ebbe
--- /dev/null
@@ -0,0 +1,6 @@
+struct a b c end;
+struct d e f end;
+
+method m(x)
+  return x.c.d;
+end;
diff --git a/gesamt_ppc/codea_abgabe_am.call b/gesamt_ppc/codea_abgabe_am.call
new file mode 100644 (file)
index 0000000..29212fc
--- /dev/null
@@ -0,0 +1,4 @@
+long s[]={12,23,34,45,53,61};
+long *t[]={s,s+2,s+1,s+3};
+extern long m(long,long **);
+RET(m(1,t)==23 && m(9,t+1)==45);
diff --git a/gesamt_ppc/codea_abgabe_am.instr b/gesamt_ppc/codea_abgabe_am.instr
new file mode 100644 (file)
index 0000000..1e8b314
--- /dev/null
@@ -0,0 +1 @@
+6
diff --git a/gesamt_ppc/codea_abgabe_an.0 b/gesamt_ppc/codea_abgabe_an.0
new file mode 100644 (file)
index 0000000..e1e8850
--- /dev/null
@@ -0,0 +1,3 @@
+method m(x)
+  return not((not this) or (not x));
+end;
diff --git a/gesamt_ppc/codea_abgabe_an.call b/gesamt_ppc/codea_abgabe_an.call
new file mode 100644 (file)
index 0000000..4399cdd
--- /dev/null
@@ -0,0 +1,2 @@
+extern long m(long,long);
+RET(m(10,6)==1 && m(0,13)==0 && m(-3,0)==0);
diff --git a/gesamt_ppc/codea_abgabe_an.instr b/gesamt_ppc/codea_abgabe_an.instr
new file mode 100644 (file)
index 0000000..64bb6b7
--- /dev/null
@@ -0,0 +1 @@
+30
diff --git a/gesamt_ppc/codea_abgabe_ao.0 b/gesamt_ppc/codea_abgabe_ao.0
new file mode 100644 (file)
index 0000000..f003ce5
--- /dev/null
@@ -0,0 +1,3 @@
+method m(x)
+  return x-(0-this);
+end;
diff --git a/gesamt_ppc/codea_abgabe_ao.call b/gesamt_ppc/codea_abgabe_ao.call
new file mode 100644 (file)
index 0000000..42a7da4
--- /dev/null
@@ -0,0 +1,2 @@
+extern long m(long,long);
+RET(m(3,4)==7 && m(-3,5)==2);
diff --git a/gesamt_ppc/codea_abgabe_ao.instr b/gesamt_ppc/codea_abgabe_ao.instr
new file mode 100644 (file)
index 0000000..1e8b314
--- /dev/null
@@ -0,0 +1 @@
+6
diff --git a/gesamt_ppc/codea_abgabe_ap.0 b/gesamt_ppc/codea_abgabe_ap.0
new file mode 100644 (file)
index 0000000..bdee923
--- /dev/null
@@ -0,0 +1,3 @@
+method m(x)
+  return 5 or x or 9;
+end;
diff --git a/gesamt_ppc/codea_abgabe_ap.call b/gesamt_ppc/codea_abgabe_ap.call
new file mode 100644 (file)
index 0000000..bb07853
--- /dev/null
@@ -0,0 +1,2 @@
+extern long m(long,long);
+RET(m(3,6)==15 && m(-3,5)==13);
diff --git a/gesamt_ppc/codea_abgabe_ap.instr b/gesamt_ppc/codea_abgabe_ap.instr
new file mode 100644 (file)
index 0000000..45a4fb7
--- /dev/null
@@ -0,0 +1 @@
+8
diff --git a/gesamt_ppc/codea_abgabe_aq.0 b/gesamt_ppc/codea_abgabe_aq.0
new file mode 100644 (file)
index 0000000..f41a469
--- /dev/null
@@ -0,0 +1,5 @@
+struct a b c end;
+
+method m(x)
+  return (this-4).c;
+end;
diff --git a/gesamt_ppc/codea_abgabe_aq.call b/gesamt_ppc/codea_abgabe_aq.call
new file mode 100644 (file)
index 0000000..bbbc716
--- /dev/null
@@ -0,0 +1,3 @@
+long s[]={12,23,34,45,53,61};
+extern long m(long *,long);
+RET(m(s,12)==23 && m(s+2,13)==45);
diff --git a/gesamt_ppc/codea_abgabe_aq.instr b/gesamt_ppc/codea_abgabe_aq.instr
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/gesamt_ppc/codea_abgabe_ar.0 b/gesamt_ppc/codea_abgabe_ar.0
new file mode 100644 (file)
index 0000000..a474c48
--- /dev/null
@@ -0,0 +1,7 @@
+method m(x y)
+  return y;
+end;
+
+method n(y x)
+  return y;
+end;
diff --git a/gesamt_ppc/codea_abgabe_ar.call b/gesamt_ppc/codea_abgabe_ar.call
new file mode 100644 (file)
index 0000000..793d7a1
--- /dev/null
@@ -0,0 +1,3 @@
+extern long m(long,long,long);
+extern long n(long,long,long);
+RET(m(1,2,3)==3 && n(4,5,6)==5);
diff --git a/gesamt_ppc/codea_abgabe_ar.instr b/gesamt_ppc/codea_abgabe_ar.instr
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/gesamt_ppc/codea_abgabe_as.0 b/gesamt_ppc/codea_abgabe_as.0
new file mode 100644 (file)
index 0000000..785163c
--- /dev/null
@@ -0,0 +1,5 @@
+struct x end;
+
+method m(x)
+  return x;
+end;
diff --git a/gesamt_ppc/codea_abgabe_as.call b/gesamt_ppc/codea_abgabe_as.call
new file mode 100644 (file)
index 0000000..eca460b
--- /dev/null
@@ -0,0 +1,3 @@
+long s[]={12,23,34,45,53,61};
+extern long m(long *,long);
+RET(m(s,78)==78 && m(s+2,13)==13);
diff --git a/gesamt_ppc/codea_abgabe_as.instr b/gesamt_ppc/codea_abgabe_as.instr
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/gesamt_ppc/codea_abgabe_x0.1 b/gesamt_ppc/codea_abgabe_x0.1
new file mode 100644 (file)
index 0000000..397db75
--- /dev/null
@@ -0,0 +1 @@
+:
diff --git a/gesamt_ppc/codea_abgabe_x1.1 b/gesamt_ppc/codea_abgabe_x1.1
new file mode 100644 (file)
index 0000000..314d73b
--- /dev/null
@@ -0,0 +1 @@
+%
diff --git a/gesamt_ppc/codea_abgabe_x2.1 b/gesamt_ppc/codea_abgabe_x2.1
new file mode 100644 (file)
index 0000000..e931977
--- /dev/null
@@ -0,0 +1 @@
+/* unvollendet
diff --git a/gesamt_ppc/codea_abgabe_x3.1 b/gesamt_ppc/codea_abgabe_x3.1
new file mode 100644 (file)
index 0000000..5242dd2
--- /dev/null
@@ -0,0 +1 @@
+: =
diff --git a/gesamt_ppc/codea_abgabe_y0.2 b/gesamt_ppc/codea_abgabe_y0.2
new file mode 100644 (file)
index 0000000..1a59e1e
--- /dev/null
@@ -0,0 +1,2 @@
+method foo(x,y)
+end;
diff --git a/gesamt_ppc/codea_abgabe_y1.2 b/gesamt_ppc/codea_abgabe_y1.2
new file mode 100644 (file)
index 0000000..47588a5
--- /dev/null
@@ -0,0 +1,3 @@
+method x()
+  this:=x;
+end;
diff --git a/gesamt_ppc/codea_abgabe_y2.2 b/gesamt_ppc/codea_abgabe_y2.2
new file mode 100644 (file)
index 0000000..2d17a51
--- /dev/null
@@ -0,0 +1,3 @@
+method x()
+  x:=x-x*x;
+end;
diff --git a/gesamt_ppc/codea_abgabe_y3.2 b/gesamt_ppc/codea_abgabe_y3.2
new file mode 100644 (file)
index 0000000..9055bd9
--- /dev/null
@@ -0,0 +1,4 @@
+method x()
+  if x<x or x=x then
+  end;
+end;
diff --git a/gesamt_ppc/codea_abgabe_y4.2 b/gesamt_ppc/codea_abgabe_y4.2
new file mode 100644 (file)
index 0000000..f557d66
--- /dev/null
@@ -0,0 +1,3 @@
+method x()
+  x := x < x < x;
+end;
diff --git a/gesamt_ppc/codea_abgabe_y5.2 b/gesamt_ppc/codea_abgabe_y5.2
new file mode 100644 (file)
index 0000000..e310325
--- /dev/null
@@ -0,0 +1,3 @@
+method x()
+  x:=x(,x);
+end;
diff --git a/gesamt_ppc/codea_abgabe_y6.2 b/gesamt_ppc/codea_abgabe_y6.2
new file mode 100644 (file)
index 0000000..aeefe39
--- /dev/null
@@ -0,0 +1,3 @@
+method x()
+  var x.x:=x;
+end;
diff --git a/gesamt_ppc/codea_abgabe_y7.2 b/gesamt_ppc/codea_abgabe_y7.2
new file mode 100644 (file)
index 0000000..90dc0fc
--- /dev/null
@@ -0,0 +1,3 @@
+method x()
+  ;
+end;
diff --git a/gesamt_ppc/codea_abgabe_y8.2 b/gesamt_ppc/codea_abgabe_y8.2
new file mode 100644 (file)
index 0000000..81fc2fd
--- /dev/null
@@ -0,0 +1,3 @@
+method x()
+  x(x,,);
+end;
diff --git a/gesamt_ppc/codea_abgabe_y9.2 b/gesamt_ppc/codea_abgabe_y9.2
new file mode 100644 (file)
index 0000000..4860d8f
--- /dev/null
@@ -0,0 +1,3 @@
+method x()
+  x.this = x;
+end;
diff --git a/gesamt_ppc/codea_abgabe_z0.3 b/gesamt_ppc/codea_abgabe_z0.3
new file mode 100644 (file)
index 0000000..fd683e3
--- /dev/null
@@ -0,0 +1,3 @@
+method m()
+  return x;
+end;
diff --git a/gesamt_ppc/codea_abgabe_za.3 b/gesamt_ppc/codea_abgabe_za.3
new file mode 100644 (file)
index 0000000..2c63ceb
--- /dev/null
@@ -0,0 +1,2 @@
+method m(x x)
+end;
diff --git a/gesamt_ppc/codea_abgabe_zb.3 b/gesamt_ppc/codea_abgabe_zb.3
new file mode 100644 (file)
index 0000000..89447ea
--- /dev/null
@@ -0,0 +1,5 @@
+method m(x)
+  if x then
+    var x:=0;
+  end;
+end;
diff --git a/gesamt_ppc/codea_abgabe_zc.3 b/gesamt_ppc/codea_abgabe_zc.3
new file mode 100644 (file)
index 0000000..62b6d5c
--- /dev/null
@@ -0,0 +1,10 @@
+method m()
+  while this do
+    var x:=this;
+    if this then
+    else
+      var x:=this;
+    end;
+  end;
+end;
+
diff --git a/gesamt_ppc/codea_abgabe_zd.3 b/gesamt_ppc/codea_abgabe_zd.3
new file mode 100644 (file)
index 0000000..0a7b327
--- /dev/null
@@ -0,0 +1,4 @@
+struct
+  a
+  a
+end;
diff --git a/gesamt_ppc/codea_abgabe_ze.3 b/gesamt_ppc/codea_abgabe_ze.3
new file mode 100644 (file)
index 0000000..5a33a8b
--- /dev/null
@@ -0,0 +1,7 @@
+struct
+  a
+end;
+
+struct
+  a
+end;
diff --git a/gesamt_ppc/codea_abgabe_zf.3 b/gesamt_ppc/codea_abgabe_zf.3
new file mode 100644 (file)
index 0000000..b98f794
--- /dev/null
@@ -0,0 +1,7 @@
+method m()
+  if this then
+    var x:=this;
+  else
+    return x;
+  end;
+end;
diff --git a/gesamt_ppc/codea_abgabe_zg.3 b/gesamt_ppc/codea_abgabe_zg.3
new file mode 100644 (file)
index 0000000..16c09e1
--- /dev/null
@@ -0,0 +1,4 @@
+method m()
+  x:=this;
+  var x:=0;
+end;
diff --git a/gesamt_ppc/codea_abgabe_zh.3 b/gesamt_ppc/codea_abgabe_zh.3
new file mode 100644 (file)
index 0000000..d5109fc
--- /dev/null
@@ -0,0 +1,7 @@
+method m()
+  a:=this;
+end;
+
+struct
+  a
+end;
diff --git a/gesamt_ppc/codea_abgabe_zi.3 b/gesamt_ppc/codea_abgabe_zi.3
new file mode 100644 (file)
index 0000000..e78de1a
--- /dev/null
@@ -0,0 +1,3 @@
+method m()
+  var x:=x;
+end;
diff --git a/gesamt_ppc/codea_abgabe_zj.3 b/gesamt_ppc/codea_abgabe_zj.3
new file mode 100644 (file)
index 0000000..1ce58c2
--- /dev/null
@@ -0,0 +1,3 @@
+method m(x)
+  return this.x;
+end;
diff --git a/gesamt_ppc/codeb_abgabe_ba.0 b/gesamt_ppc/codeb_abgabe_ba.0
new file mode 100644 (file)
index 0000000..de7d90c
--- /dev/null
@@ -0,0 +1,4 @@
+method m(x)
+  x := this-x;
+  return x*2;
+end;
diff --git a/gesamt_ppc/codeb_abgabe_ba.call b/gesamt_ppc/codeb_abgabe_ba.call
new file mode 100644 (file)
index 0000000..e3f3c99
--- /dev/null
@@ -0,0 +1,5 @@
+extern long m(long,long);
+int r1 = m(7,4);
+int r2 = m(18,22);
+printf("r1: %d\nr2: %d\n", r1, r2);
+RET(r1==6 && r2==-8);
diff --git a/gesamt_ppc/codeb_abgabe_ba.instr b/gesamt_ppc/codeb_abgabe_ba.instr
new file mode 100644 (file)
index 0000000..45a4fb7
--- /dev/null
@@ -0,0 +1 @@
+8
diff --git a/gesamt_ppc/codeb_abgabe_bb.0 b/gesamt_ppc/codeb_abgabe_bb.0
new file mode 100644 (file)
index 0000000..27ee1de
--- /dev/null
@@ -0,0 +1,4 @@
+method m()
+  var that:=3*this;
+  return this or that;
+end;
diff --git a/gesamt_ppc/codeb_abgabe_bb.call b/gesamt_ppc/codeb_abgabe_bb.call
new file mode 100644 (file)
index 0000000..24d9f34
--- /dev/null
@@ -0,0 +1,2 @@
+extern long m(long);
+RET(m(7)==23 && m(13)==47);
diff --git a/gesamt_ppc/codeb_abgabe_bb.instr b/gesamt_ppc/codeb_abgabe_bb.instr
new file mode 100644 (file)
index 0000000..45a4fb7
--- /dev/null
@@ -0,0 +1 @@
+8
diff --git a/gesamt_ppc/codeb_abgabe_bc.0 b/gesamt_ppc/codeb_abgabe_bc.0
new file mode 100644 (file)
index 0000000..6b69b2e
--- /dev/null
@@ -0,0 +1,7 @@
+method mymax(that)
+  if this<that then
+    return that;
+  else
+    return this;
+  end;
+end;
diff --git a/gesamt_ppc/codeb_abgabe_bc.call b/gesamt_ppc/codeb_abgabe_bc.call
new file mode 100644 (file)
index 0000000..f4e86b1
--- /dev/null
@@ -0,0 +1,2 @@
+extern long mymax(long,long);
+RET(mymax(7,4)==7 && mymax(18,22)==22);
diff --git a/gesamt_ppc/codeb_abgabe_bc.instr b/gesamt_ppc/codeb_abgabe_bc.instr
new file mode 100644 (file)
index 0000000..45a4fb7
--- /dev/null
@@ -0,0 +1 @@
+8
diff --git a/gesamt_ppc/codeb_abgabe_bd.0 b/gesamt_ppc/codeb_abgabe_bd.0
new file mode 100644 (file)
index 0000000..3d086a9
--- /dev/null
@@ -0,0 +1,6 @@
+method mymax(that)
+  if not (this<that) then
+    that:=this;
+  end;
+  return that;
+end;
diff --git a/gesamt_ppc/codeb_abgabe_bd.call b/gesamt_ppc/codeb_abgabe_bd.call
new file mode 100644 (file)
index 0000000..f4e86b1
--- /dev/null
@@ -0,0 +1,2 @@
+extern long mymax(long,long);
+RET(mymax(7,4)==7 && mymax(18,22)==22);
diff --git a/gesamt_ppc/codeb_abgabe_bd.instr b/gesamt_ppc/codeb_abgabe_bd.instr
new file mode 100644 (file)
index 0000000..ec63514
--- /dev/null
@@ -0,0 +1 @@
+9
diff --git a/gesamt_ppc/codeb_abgabe_be.0 b/gesamt_ppc/codeb_abgabe_be.0
new file mode 100644 (file)
index 0000000..a2e2e61
--- /dev/null
@@ -0,0 +1,12 @@
+method fib()
+  var n:=0;
+  var a:=0;
+  var b:=1;
+  while n<this do
+    n:=n--1;
+    var t:=a-(0-b);
+    a:=b;
+    b:=t;
+  end;
+  return a;
+end;
diff --git a/gesamt_ppc/codeb_abgabe_be.call b/gesamt_ppc/codeb_abgabe_be.call
new file mode 100644 (file)
index 0000000..aaf92c7
--- /dev/null
@@ -0,0 +1,2 @@
+extern long fib(long);
+RET(3==fib(4));
diff --git a/gesamt_ppc/codeb_abgabe_be.instr b/gesamt_ppc/codeb_abgabe_be.instr
new file mode 100644 (file)
index 0000000..8f92bfd
--- /dev/null
@@ -0,0 +1 @@
+35
diff --git a/gesamt_ppc/codeb_abgabe_bf.0 b/gesamt_ppc/codeb_abgabe_bf.0
new file mode 100644 (file)
index 0000000..2c56204
--- /dev/null
@@ -0,0 +1,11 @@
+method ggt(b)
+  var a:=this;
+  while b do
+    if b<a then
+      a:=a-b;
+    else
+      b:=b-a;
+    end;
+  end;
+  return a;
+end;
diff --git a/gesamt_ppc/codeb_abgabe_bf.call b/gesamt_ppc/codeb_abgabe_bf.call
new file mode 100644 (file)
index 0000000..72a0cac
--- /dev/null
@@ -0,0 +1,2 @@
+extern long ggt(long, long);
+RET (6==ggt(42,108));
diff --git a/gesamt_ppc/codeb_abgabe_bf.instr b/gesamt_ppc/codeb_abgabe_bf.instr
new file mode 100644 (file)
index 0000000..95f9650
--- /dev/null
@@ -0,0 +1 @@
+49
diff --git a/gesamt_ppc/codeb_abgabe_bg.0 b/gesamt_ppc/codeb_abgabe_bg.0
new file mode 100644 (file)
index 0000000..21e3b7b
--- /dev/null
@@ -0,0 +1,11 @@
+struct next end;
+
+method length()
+  var l:=this;
+  var len:=0;
+  while l do
+    l:=l.next;
+    len:=len--1;
+  end;
+  return len;
+end;
diff --git a/gesamt_ppc/codeb_abgabe_bg.call b/gesamt_ppc/codeb_abgabe_bg.call
new file mode 100644 (file)
index 0000000..41d2795
--- /dev/null
@@ -0,0 +1,9 @@
+typedef struct list {struct list *next; } list;
+
+extern long length(list *);
+list a={NULL};
+list b={&a};
+list c={&b};
+list d={&c};
+list e={&a};
+RET(2==length(&e) && 4==length(&d));
diff --git a/gesamt_ppc/codeb_abgabe_bg.instr b/gesamt_ppc/codeb_abgabe_bg.instr
new file mode 100644 (file)
index 0000000..7facc89
--- /dev/null
@@ -0,0 +1 @@
+36
diff --git a/gesamt_ppc/codeb_abgabe_bh.0 b/gesamt_ppc/codeb_abgabe_bh.0
new file mode 100644 (file)
index 0000000..635e6ad
--- /dev/null
@@ -0,0 +1,9 @@
+struct next val end;
+
+
+method insert(val list)
+/* usage: list:=node.insert(5,list) */
+  this.val := val;
+  next := list;
+  return this;
+end;
diff --git a/gesamt_ppc/codeb_abgabe_bh.call b/gesamt_ppc/codeb_abgabe_bh.call
new file mode 100644 (file)
index 0000000..5b44d8b
--- /dev/null
@@ -0,0 +1,6 @@
+typedef struct list {struct list *next; long val;} list;
+list *insert(list *, long, list *);
+list a={NULL,7};
+list b={NULL,2};
+RET((&a)==insert(&a, 3, &b) && 
+     a.next==&b && a.val==3 && b.next==NULL && b.val==2);
diff --git a/gesamt_ppc/codeb_abgabe_bh.instr b/gesamt_ppc/codeb_abgabe_bh.instr
new file mode 100644 (file)
index 0000000..b8626c4
--- /dev/null
@@ -0,0 +1 @@
+4
diff --git a/gesamt_ppc/codeb_abgabe_bi.0 b/gesamt_ppc/codeb_abgabe_bi.0
new file mode 100644 (file)
index 0000000..d7e17d8
--- /dev/null
@@ -0,0 +1,17 @@
+struct a b c end;
+
+method m(flag)
+  a:=b-1;
+  if flag then
+    b:=c-1;
+    var a:=95;
+    c:=a-1;
+  else
+    a:=a-10;
+    var b:=a*2;
+    b:=23;
+    c:=b*2;
+  end;
+  b:=b-17;
+  return this;
+end;
diff --git a/gesamt_ppc/codeb_abgabe_bi.call b/gesamt_ppc/codeb_abgabe_bi.call
new file mode 100644 (file)
index 0000000..6c129e1
--- /dev/null
@@ -0,0 +1,9 @@
+typedef struct foo {long a; long b; long c;} foo;
+extern foo *m(foo *, long);
+foo s1={29,37,41};
+foo s2={6,28,216};
+
+RET((&s1)==m(&s1,25) && (&s2)==m(&s2,0) &&
+    s1.a==36 && s1.b==23 && s1.c==94 &&
+    s2.a==17 && s2.b==11 && s2.c==46);
+
diff --git a/gesamt_ppc/codeb_abgabe_bi.instr b/gesamt_ppc/codeb_abgabe_bi.instr
new file mode 100644 (file)
index 0000000..64bb6b7
--- /dev/null
@@ -0,0 +1 @@
+30
diff --git a/gesamt_ppc/codeb_abgabe_bj.0 b/gesamt_ppc/codeb_abgabe_bj.0
new file mode 100644 (file)
index 0000000..427e7de
--- /dev/null
@@ -0,0 +1,10 @@
+struct elem end;
+
+method vadd(v n)
+  while 0<n do
+    n:=n-1;
+    (this-(-4*n)).elem := (this-(n*-4)).elem - (0-(v-(n*-4)).elem);
+  end;
+  return this;
+end;
+
diff --git a/gesamt_ppc/codeb_abgabe_bj.call b/gesamt_ppc/codeb_abgabe_bj.call
new file mode 100644 (file)
index 0000000..2dd64d2
--- /dev/null
@@ -0,0 +1,14 @@
+extern long *vadd(long *, long *, long);
+long a[]={7,11,13};
+long b[]={23,42,5};
+int i;
+for(i=0; i<3; i++) {
+       printf("a[%i]: %d, b[%i]: %d\n", i, a[i], i, b[i]);
+}
+int ret = vadd(a,b,2)==a;
+for(i=0; i<3; i++) {
+       printf("a[%i]: %d, b[%i]: %d\n", i, a[i], i, b[i]);
+}
+RET(ret &&
+    a[0]==30 && a[1]==53 && a[2]==13 &&
+    b[0]==23 && b[1]==42 && b[2]==5);
diff --git a/gesamt_ppc/codeb_abgabe_bj.instr b/gesamt_ppc/codeb_abgabe_bj.instr
new file mode 100644 (file)
index 0000000..2bd5a0a
--- /dev/null
@@ -0,0 +1 @@
+22
diff --git a/gesamt_ppc/georg_fib_000.call b/gesamt_ppc/georg_fib_000.call
new file mode 120000 (symlink)
index 0000000..3b3c2a5
--- /dev/null
@@ -0,0 +1 @@
+../codeb/georg_fib_000.call
\ No newline at end of file
diff --git a/gesamt_ppc/georg_fib_020.call b/gesamt_ppc/georg_fib_020.call
new file mode 120000 (symlink)
index 0000000..de02b65
--- /dev/null
@@ -0,0 +1 @@
+../codeb/georg_fib_020.call
\ No newline at end of file
diff --git a/gesamt_ppc/georg_fib_100.call b/gesamt_ppc/georg_fib_100.call
new file mode 120000 (symlink)
index 0000000..6ee1412
--- /dev/null
@@ -0,0 +1 @@
+georg_fib_000.call
\ No newline at end of file
diff --git a/gesamt_ppc/georg_fib_101.0 b/gesamt_ppc/georg_fib_101.0
new file mode 100644 (file)
index 0000000..b4ed3ce
--- /dev/null
@@ -0,0 +1,23 @@
+/* fibonacci */
+
+/* F_0 = 0 */
+/* F_1 = 1 */
+/* F_n = F_{n-1} + F_{n-2} */
+
+/*
+return e;
+return t-t;
+return t-(e);
+return t-(0-t);
+return c-(0-c);
+return mref()-(0-mref());
+return t.id()-(0-t.id());
+return (e).id()-(0-(e).id());
+return (t-t).id()-(0-(t-t).id());
+return (this-1).fib()-(0-(this-2).fib());
+*/
+
+method fib()
+       if this < 2 then return this; end;
+       return (this-1).fib()-(0-(this-2).fib());
+end;
diff --git a/gesamt_ppc/georg_fib_101.call b/gesamt_ppc/georg_fib_101.call
new file mode 120000 (symlink)
index 0000000..227109c
--- /dev/null
@@ -0,0 +1 @@
+georg_fib_100.call
\ No newline at end of file
diff --git a/gesamt_ppc/georg_fib_101.instr b/gesamt_ppc/georg_fib_101.instr
new file mode 100644 (file)
index 0000000..328e4ce
--- /dev/null
@@ -0,0 +1 @@
+3694
diff --git a/gesamt_ppc/georg_fib_102.0 b/gesamt_ppc/georg_fib_102.0
new file mode 100644 (file)
index 0000000..4aa19af
--- /dev/null
@@ -0,0 +1,25 @@
+/* fibonacci */
+
+/* F_0 = 0 */
+/* F_1 = 1 */
+/* F_n = F_{n-1} + F_{n-2} */
+
+/*
+return e;
+return t-t;
+return t-(e);
+return t-(0-t);
+return c-(0-c);
+return mref()-(0-mref());
+return t.id()-(0-t.id());
+return (e).id()-(0-(e).id());
+return (t-t).id()-(0-(t-t).id());
+return (this-1).fib()-(0-(this-2).fib());
+*/
+
+method fib()
+       if this < 2 then return this; end;
+       var a := (this-1).fib();
+       var b := (this-2).fib();
+       return a-(0-b);
+end;
diff --git a/gesamt_ppc/georg_fib_102.call b/gesamt_ppc/georg_fib_102.call
new file mode 120000 (symlink)
index 0000000..227109c
--- /dev/null
@@ -0,0 +1 @@
+georg_fib_100.call
\ No newline at end of file
diff --git a/gesamt_ppc/georg_fib_102.instr b/gesamt_ppc/georg_fib_102.instr
new file mode 100644 (file)
index 0000000..328e4ce
--- /dev/null
@@ -0,0 +1 @@
+3694
diff --git a/gesamt_ppc/georg_fib_120.call b/gesamt_ppc/georg_fib_120.call
new file mode 120000 (symlink)
index 0000000..e41caeb
--- /dev/null
@@ -0,0 +1 @@
+georg_fib_020.call
\ No newline at end of file
diff --git a/gesamt_ppc/georg_fib_121.0 b/gesamt_ppc/georg_fib_121.0
new file mode 100644 (file)
index 0000000..47cb4a0
--- /dev/null
@@ -0,0 +1,10 @@
+/* fibonacci */
+
+/* F_0 = 0 */
+/* F_1 = 1 */
+/* F_n = F_{n-1} + F_{n-2} */
+
+method fib(x)
+       if x < 2 then return x; end;
+       return fib(x-1)-(0-fib(x-2));
+end;
diff --git a/gesamt_ppc/georg_fib_121.call b/gesamt_ppc/georg_fib_121.call
new file mode 120000 (symlink)
index 0000000..cff1e78
--- /dev/null
@@ -0,0 +1 @@
+georg_fib_120.call
\ No newline at end of file
diff --git a/gesamt_ppc/georg_fib_121.instr b/gesamt_ppc/georg_fib_121.instr
new file mode 100644 (file)
index 0000000..bb06e56
--- /dev/null
@@ -0,0 +1 @@
+4134
diff --git a/gesamt_ppc/georg_fib_122.0 b/gesamt_ppc/georg_fib_122.0
new file mode 100644 (file)
index 0000000..dd8eddb
--- /dev/null
@@ -0,0 +1,12 @@
+/* fibonacci */
+
+/* F_0 = 0 */
+/* F_1 = 1 */
+/* F_n = F_{n-1} + F_{n-2} */
+
+method fib(x)
+       if x < 2 then return x; end;
+       var a := fib(x-1);
+       var b := fib(x-2);
+       return a-(0-b);
+end;
diff --git a/gesamt_ppc/georg_fib_122.call b/gesamt_ppc/georg_fib_122.call
new file mode 120000 (symlink)
index 0000000..cff1e78
--- /dev/null
@@ -0,0 +1 @@
+georg_fib_120.call
\ No newline at end of file
diff --git a/gesamt_ppc/georg_fib_122.instr b/gesamt_ppc/georg_fib_122.instr
new file mode 100644 (file)
index 0000000..d80cdf9
--- /dev/null
@@ -0,0 +1 @@
+4354
diff --git a/gesamt_ppc/intelli_00.0 b/gesamt_ppc/intelli_00.0
new file mode 100644 (file)
index 0000000..9ebd992
--- /dev/null
@@ -0,0 +1,7 @@
+method m()
+       return a(4);
+end;
+
+method a(x)
+       return this * x;
+end;
diff --git a/gesamt_ppc/intelli_00.call b/gesamt_ppc/intelli_00.call
new file mode 100644 (file)
index 0000000..42806e9
--- /dev/null
@@ -0,0 +1,3 @@
+extern int m(int);
+int ret = m(10);
+RET(ret == 40);
diff --git a/gesamt_ppc/intelli_00.instr b/gesamt_ppc/intelli_00.instr
new file mode 100644 (file)
index 0000000..b1bd38b
--- /dev/null
@@ -0,0 +1 @@
+13
diff --git a/gesamt_ppc/intelli_01.0 b/gesamt_ppc/intelli_01.0
new file mode 100644 (file)
index 0000000..372f35d
--- /dev/null
@@ -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_ppc/intelli_01.call b/gesamt_ppc/intelli_01.call
new file mode 100644 (file)
index 0000000..6593e35
--- /dev/null
@@ -0,0 +1,7 @@
+extern int m(int);
+
+int t = m(-6);
+
+//printf("%d\n", t);
+
+RET(m(-6) == 80);
diff --git a/gesamt_ppc/intelli_01.instr b/gesamt_ppc/intelli_01.instr
new file mode 100644 (file)
index 0000000..c739b42
--- /dev/null
@@ -0,0 +1 @@
+44
diff --git a/gesamt_ppc/intelli_02.0 b/gesamt_ppc/intelli_02.0
new file mode 100644 (file)
index 0000000..d1d9c86
--- /dev/null
@@ -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_ppc/intelli_02.call b/gesamt_ppc/intelli_02.call
new file mode 100644 (file)
index 0000000..03aac0e
--- /dev/null
@@ -0,0 +1,7 @@
+extern int m(int);
+
+int t = m(-50);
+
+//printf("%d\n", t);
+
+RET(t == 67550);
diff --git a/gesamt_ppc/intelli_02.instr b/gesamt_ppc/intelli_02.instr
new file mode 100644 (file)
index 0000000..82cced2
--- /dev/null
@@ -0,0 +1 @@
+51
diff --git a/gesamt_ppc/intelli_03.0 b/gesamt_ppc/intelli_03.0
new file mode 100644 (file)
index 0000000..a3303bf
--- /dev/null
@@ -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;
diff --git a/gesamt_ppc/intelli_03.call b/gesamt_ppc/intelli_03.call
new file mode 100644 (file)
index 0000000..5a280cd
--- /dev/null
@@ -0,0 +1,21 @@
+extern int m(int* ar1, int *ar2);
+
+int z1[] = { 0, 2, 4, 6, 8, 10, 12 };
+int z2[] = { 10, 20, 40, 60, 80, 100, 120 };
+int i;
+
+for(i=0; i < sizeof z1/sizeof z1[0]; i++) {
+       printf("z1[%i]: %d, z2[%i]: %d\n", i, z1[i], i, z2[i]);
+}
+
+int ret = m(&z1[1], &z2[1]);
+printf("ret: %d\n", ret);
+
+for(i=0; i < sizeof z1/sizeof z1[0]; i++) {
+       printf("z1[%i]: %d, z2[%i]: %d\n", i, z1[i], i, z2[i]);
+}
+printf("anmerkung: dieser testfall ist von seiteneffekten gepraegt\n"
+       "es *koennte* passieren, dass der testfall richtig ist obwohl er\n"
+       "fehlschlaegt, da die auswertungsreihenfolge nicht vorgegeben ist\n\n");
+
+RET((ret == -16 || ret == -14) && 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);
diff --git a/gesamt_ppc/intelli_03.instr b/gesamt_ppc/intelli_03.instr
new file mode 100644 (file)
index 0000000..3ad5abd
--- /dev/null
@@ -0,0 +1 @@
+99
diff --git a/gesamt_ppc/lewurm_00.0 b/gesamt_ppc/lewurm_00.0
new file mode 100644 (file)
index 0000000..dc9b91c
--- /dev/null
@@ -0,0 +1,8 @@
+method f()
+       var x := g();
+       return x;
+end;
+
+method g()
+       return 4;
+end;
diff --git a/gesamt_ppc/lewurm_00.call b/gesamt_ppc/lewurm_00.call
new file mode 100644 (file)
index 0000000..e5ebb88
--- /dev/null
@@ -0,0 +1,2 @@
+long f(long);
+RET(f(0xdead) == 4);
diff --git a/gesamt_ppc/lewurm_00.instr b/gesamt_ppc/lewurm_00.instr
new file mode 100644 (file)
index 0000000..b4de394
--- /dev/null
@@ -0,0 +1 @@
+11
diff --git a/gesamt_ppc/lewurm_01.0 b/gesamt_ppc/lewurm_01.0
new file mode 100644 (file)
index 0000000..2e59564
--- /dev/null
@@ -0,0 +1,8 @@
+method f(a)
+       return (g(a*5) - (0-this));
+end;
+
+method g(b)
+       b := (0-b) - 100;
+       return this-b;
+end;
diff --git a/gesamt_ppc/lewurm_01.call b/gesamt_ppc/lewurm_01.call
new file mode 100644 (file)
index 0000000..f0d92ca
--- /dev/null
@@ -0,0 +1,5 @@
+long f(long,long);
+#define ERG 320
+int ret = f(100,4);
+printf("ret ist %i (sollte %i sein)\n", ret, ERG);
+RET(ret == ERG);
diff --git a/gesamt_ppc/lewurm_01.instr b/gesamt_ppc/lewurm_01.instr
new file mode 100644 (file)
index 0000000..d6b2404
--- /dev/null
@@ -0,0 +1 @@
+19
diff --git a/gesamt_ppc/lewurm_02.0 b/gesamt_ppc/lewurm_02.0
new file mode 100644 (file)
index 0000000..25eb517
--- /dev/null
@@ -0,0 +1,13 @@
+method f(a)
+       var x := a--100;
+       var y := g(x);
+       y := y - 100 - (0-x);
+       return y;
+end;
+
+method g(b)
+       var x := 1;
+       var y := 2;
+       var z := -3;
+       return b-x-y-z;
+end;
diff --git a/gesamt_ppc/lewurm_02.call b/gesamt_ppc/lewurm_02.call
new file mode 100644 (file)
index 0000000..fdc828b
--- /dev/null
@@ -0,0 +1,5 @@
+long f(long,long);
+#define ERG 200
+int ret = f(0xdead,50);
+printf("ret ist %i (sollte %i sein)\n", ret, ERG);
+RET(ret == ERG);
diff --git a/gesamt_ppc/lewurm_02.instr b/gesamt_ppc/lewurm_02.instr
new file mode 100644 (file)
index 0000000..e85087a
--- /dev/null
@@ -0,0 +1 @@
+31
diff --git a/gesamt_ppc/lewurm_03.0 b/gesamt_ppc/lewurm_03.0
new file mode 100644 (file)
index 0000000..70fe437
--- /dev/null
@@ -0,0 +1,7 @@
+method f()
+       return (this-50).g();
+end;
+
+method g()
+       return this--50;
+end;
diff --git a/gesamt_ppc/lewurm_03.call b/gesamt_ppc/lewurm_03.call
new file mode 100644 (file)
index 0000000..bfcd116
--- /dev/null
@@ -0,0 +1,5 @@
+long f(long);
+#define ERG 320
+int ret = f(ERG);
+printf("ret ist %i (sollte %i sein)\n", ret, ERG);
+RET(ret == ERG);
diff --git a/gesamt_ppc/lewurm_03.instr b/gesamt_ppc/lewurm_03.instr
new file mode 100644 (file)
index 0000000..48082f7
--- /dev/null
@@ -0,0 +1 @@
+12
diff --git a/gesamt_ppc/lewurm_04.0 b/gesamt_ppc/lewurm_04.0
new file mode 100644 (file)
index 0000000..3cb87cb
--- /dev/null
@@ -0,0 +1,8 @@
+method f()
+                       /* 14 */      /* 16 */ /* 15 */
+       return (this-1).g()-(this-2).g()-g();
+end;
+
+method g()
+       return this;
+end;
diff --git a/gesamt_ppc/lewurm_04.call b/gesamt_ppc/lewurm_04.call
new file mode 100644 (file)
index 0000000..ef1c964
--- /dev/null
@@ -0,0 +1,9 @@
+long f(long);
+#define ERG(a) ((a-1)-(a-2)-a)
+int ret1 = f(-10);
+int ret2 = f(1337);
+int ret3 = f(-358193);
+printf("ret1 ist %6i (sollte %6i sein)\n", ret1, ERG(-10));
+printf("ret2 ist %6i (sollte %6i sein)\n", ret2, ERG(1337));
+printf("ret3 ist %6i (sollte %6i sein)\n", ret3, ERG(-358193));
+RET(ret1 == ERG(-10) && ret2 == ERG(1337) && ret3 == ERG(-358193));
diff --git a/gesamt_ppc/lewurm_04.instr b/gesamt_ppc/lewurm_04.instr
new file mode 100644 (file)
index 0000000..f96ac06
--- /dev/null
@@ -0,0 +1 @@
+105
diff --git a/gesamt_ppc/lewurm_05.0 b/gesamt_ppc/lewurm_05.0
new file mode 100644 (file)
index 0000000..125197b
--- /dev/null
@@ -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_ppc/lewurm_05.call b/gesamt_ppc/lewurm_05.call
new file mode 100644 (file)
index 0000000..0db317d
--- /dev/null
@@ -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_ppc/lewurm_05.instr b/gesamt_ppc/lewurm_05.instr
new file mode 100644 (file)
index 0000000..dd47563
--- /dev/null
@@ -0,0 +1 @@
+76
diff --git a/gesamt_ppc/lewurm_06.0 b/gesamt_ppc/lewurm_06.0
new file mode 100644 (file)
index 0000000..4f6220a
--- /dev/null
@@ -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_ppc/lewurm_06.call b/gesamt_ppc/lewurm_06.call
new file mode 100644 (file)
index 0000000..8a0a9f5
--- /dev/null
@@ -0,0 +1,12 @@
+long f(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_ppc/lewurm_06.instr b/gesamt_ppc/lewurm_06.instr
new file mode 100644 (file)
index 0000000..b5489e5
--- /dev/null
@@ -0,0 +1 @@
+69
diff --git a/gesamt_ppc/lewurm_07.0 b/gesamt_ppc/lewurm_07.0
new file mode 100644 (file)
index 0000000..b47f691
--- /dev/null
@@ -0,0 +1,8 @@
+struct a end;
+method f()
+       return this.a - inc();
+end;
+method inc()
+       this.a := this.a--1;
+       return this.a;
+end;
diff --git a/gesamt_ppc/lewurm_07.call b/gesamt_ppc/lewurm_07.call
new file mode 100644 (file)
index 0000000..2ba88c6
--- /dev/null
@@ -0,0 +1,7 @@
+long f(long[]);
+long ar[] = {100};
+int ret = f(ar);
+#define ERG1 (100 - 101)
+#define ERG2 (101 - 101)
+printf("ret ist %2i (sollte %2i ODER %2i sein)\n", ret, ERG1, ERG2);
+RET(ret == ERG1 || ret == ERG2);
diff --git a/gesamt_ppc/lewurm_07.instr b/gesamt_ppc/lewurm_07.instr
new file mode 100644 (file)
index 0000000..60d3b2f
--- /dev/null
@@ -0,0 +1 @@
+15
diff --git a/gesamt_ppc/lewurm_08.0 b/gesamt_ppc/lewurm_08.0
new file mode 100644 (file)
index 0000000..e899d23
--- /dev/null
@@ -0,0 +1,17 @@
+method fo0(a b c d)
+       var x := g();
+       /*return a-b-c-d-x; */
+       return b;
+end;
+method g()
+       h();
+       return -100;
+end;
+method h()
+       var q := 0;
+       var w := 0;
+       var e := 0;
+       var r := 0;
+       var t := 0;
+       return (q*w)-(e*r)-t;
+end;
diff --git a/gesamt_ppc/lewurm_08.call b/gesamt_ppc/lewurm_08.call
new file mode 100644 (file)
index 0000000..ec05c4a
--- /dev/null
@@ -0,0 +1,11 @@
+long fo0(long, long, long, long, long);
+#define ARG1 10
+#define ARG2 -10
+#define ARG3 -20
+#define ARG4 -30
+
+#define ERG (ARG1 - ARG2 - ARG3 - ARG4 + 100)
+
+int ret = fo0(0xdead, ARG1, ARG2, ARG3, ARG4);
+printf("ret ist %8i (sollte %8i sein)\n", ret, ERG);
+RET(ret == ERG);
diff --git a/gesamt_ppc/lewurm_08.instr b/gesamt_ppc/lewurm_08.instr
new file mode 100644 (file)
index 0000000..d81cc07
--- /dev/null
@@ -0,0 +1 @@
+42
diff --git a/gesamt_ppc/lewurm_09.0 b/gesamt_ppc/lewurm_09.0
new file mode 100644 (file)
index 0000000..bba113f
--- /dev/null
@@ -0,0 +1,20 @@
+/* inspired by s'evil skinn0rEE ! */
+struct a end;
+method f()
+       return ((this--4).g()).h(j());
+end;
+
+method g()
+       this.a := this.a*10;
+       return this--4;
+end;
+
+method h()
+       this.a := this.a*20;
+       return this--4;
+end;
+
+method j()
+       this.a := this.a*30;
+       return this--4;
+end;
diff --git a/gesamt_ppc/lewurm_09.call b/gesamt_ppc/lewurm_09.call
new file mode 100644 (file)
index 0000000..db132e6
--- /dev/null
@@ -0,0 +1,20 @@
+unsigned int f(unsigned int[]);
+
+/* hint: pointer arithmetic in C */
+#define ERG (ar + 3)
+
+unsigned int ar[] = {5, 6, 7};
+unsigned int ar_copy[] = {5, 6, 7};
+int j;
+unsigned int ret;
+
+printf("adr of ar: 0x%08lx\n", ar);
+for(j=0; j < sizeof ar / sizeof ar[0]; j++) {
+       printf("ar[%i]: %d\n", j, ar[j]);
+}
+ret = f(ar);
+printf("ret ist 0x%08lx (sollte 0x%08lx sein)\n", ret, ERG);
+for(j=0; j < sizeof ar / sizeof ar[0]; j++) {
+       printf("ar[%i]: %d\n", j, ar[j]);
+}
+RET(ret == (unsigned int) ERG && ar[0] == ar_copy[0] * 30 && ar[1] == ar_copy[1] * 10 && ar[2] == ar_copy[2] * 20);
diff --git a/gesamt_ppc/lewurm_09.instr b/gesamt_ppc/lewurm_09.instr
new file mode 100644 (file)
index 0000000..8f92bfd
--- /dev/null
@@ -0,0 +1 @@
+35
diff --git a/scripts/callingconvention.c b/scripts/callingconvention.c
new file mode 100644 (file)
index 0000000..deb1db1
--- /dev/null
@@ -0,0 +1,13 @@
+/* gcc -c -fomit-frame-pointer -fno-defer-pop callingconvention.c */
+
+#include <stdlib.h>
+
+extern int call(void);
+
+#define CHECKNUM 0x1234567812345678
+long callchecking() 
+{
+  long ret;
+  ret=call();
+  return ret;
+}
index 2fe045a7bce87066090dd9e0fa947a5a7b3b466e..d11cb57fd04c0711000265ea991e7daaca9c7c38 100644 (file)
Binary files a/scripts/callingconvention.o and b/scripts/callingconvention.o differ
index 5df7c42c1fe7ec808b029773c6a24dab6fc42af3..4fff543d96e94d3b698c6f350a28866c8511d22b 100755 (executable)
@@ -6,11 +6,11 @@ PROGRAM=./$beispiel
 errnum=0
 prgnum=0
 
-#LOC=.
-LOC=/usr/ftp/pub/ubvl/test/$beispiel
+LOC=~/test/scripts/
+#LOC=/usr/ftp/pub/ubvl/test/$beispiel
 LOC2=~/test/$beispiel
 
-/usr/ftp/pub/ublu/test/accounttest || exit 1
+#/usr/ftp/pub/ublu/test/accounttest || exit 1
 allow_null_glob_expansion=1
 
 if [ ! -d ~/abgabe/$beispiel ]; then
diff --git a/scripts/modlvatest_gesamt_ppc.sh b/scripts/modlvatest_gesamt_ppc.sh
new file mode 100755 (executable)
index 0000000..456bc4b
--- /dev/null
@@ -0,0 +1,152 @@
+#! /bin/bash
+
+beispiel=gesamt_ppc
+PROGRAM=./$beispiel
+
+errnum=0
+prgnum=0
+
+LOC=~/test/scripts/
+#LOC=/usr/ftp/pub/ubvl/test/$beispiel
+LOC2=~/test/$beispiel
+
+#/usr/ftp/pub/ublu/test/accounttest || exit 1
+allow_null_glob_expansion=1
+
+if [ ! -d ~/abgabe/$beispiel ]; then
+  echo "Fehler: Verzeichnis ~/abgabe/$beispiel existiert nicht."
+  exit 1
+else
+  cd ~/abgabe/$beispiel
+  echo 'Teste "make clean"'
+  make clean
+  /usr/ftp/pub/ubvl/test/cleantest
+  echo 'Teste "make"'
+  make
+fi
+
+if test ! -x $PROGRAM
+then
+       echo "Fehler: Kein Programm $PROGRAM"
+       exit 1
+fi
+let prgnum=0
+for i in $LOC/*.0 $LOC2/*.0
+do
+       if [ -f $i ]; then
+           let prgnum=prgnum+1
+           let errorfound=0
+           echo "==========> Eingabe von $i:"
+           cat $i
+           echo
+           RESFILE=test${beispiel}out$$
+           $PROGRAM <$i >$RESFILE
+           retval=$?
+           echo -n "Übersetzung: "
+           if test $retval -eq 0
+           then
+                   echo "Status korrekt"
+           else
+                   echo "[Errot] Status=$retval. Erwartet: 0"
+                   let errorfound=1
+           fi
+           echo
+           echo "Ausgabe:"
+               if [ -f ~/test/scripts/clr.py ]; then
+                       cat $RESFILE | ~/test/scripts/clr.py
+               else
+                       cat $RESFILE
+               fi
+           mv -f $RESFILE $RESFILE.s
+           CALLFILE=${i%.*}.call
+           echo
+           if [ ! -f $CALLFILE ]; then
+               echo "Fehler: Datei $CALLFILE existiert nicht, kann Code nicht ausführen..."
+               exit 1
+           else
+               echo "Übersetze und linke das Testprogramm:"
+               if cc -g -I. -DCALL=\"$CALLFILE\" $LOC/testmain.c $LOC/callingconvention.o $RESFILE.s; then
+                   echo
+                   echo "Rufe folgendes Codefragment auf:"
+                   cat $CALLFILE
+                   echo
+                   ./a.out 
+                   retval=$?
+                   # test callee saved registers
+                   if [ "$retval" -ge 12 ] && [ "$retval" -le 15 ]; then
+                       echo "[Error] Callee-saved register %r$retval modified."
+                        let errorfound=1
+                   elif [ "$retval" -eq 11 ]; then
+                       echo "[Error] Callee-saved register %rbx modified."
+                        let errorfound=1
+                   elif [ "$retval" -eq 16 ]; then
+                       echo "[Error] Callee-saved register %rbp modified."
+                        let errorfound=1
+                   elif [ "$retval" -eq 30 ]; then
+                       echo "[Error] Stack pointer %rsp modified."
+                        let errorfound=1
+                    else
+                        # test signals  
+                       test $retval -gt 127
+                       retsig=$?
+                       test ${i##*.} = xin
+                       expsig=$?
+                       if test $retsig -eq $expsig; then
+                           if test $retval -eq 1; then
+                               echo "[Error] Das Ergebnis des Aufrufs ist falsch."
+                               let errorfound=1
+                           elif test $retval -eq 0; then
+                               echo "Das Ergebnis des Ausdrucks ist korrekt."
+                           else
+                               echo "[Error] Erzeugter Code verhaelt sich bzgl. Signalerzeugung anders als erwartet."
+                               let errorfound=1
+                           fi
+                       else
+                           echo "[Error] Erzeugter Code verhaelt sich bezueglich Signalerzeugung anders als erwartet."
+                           let errorfound=1
+                           echo "Rueckgabewert = $retval";
+                       fi
+                   fi
+                   echo
+               else
+                   echo "[Error] Erzeugter Code konnte nicht assembliert und gelinkt werden."
+                   let errorfound=1
+               fi
+           fi
+           let errnum=errnum+errorfound
+               if [ 1 -eq $errorfound ]; then
+                       rm *.s
+                       rm *.out
+                       exit 3;
+               fi
+           rm -f a.out $RESFILE $RESFILE.s
+       fi
+done
+
+for i in $LOC/*.[123] $LOC2/*.[123]
+do
+       if [ -f $i ]; then
+       let prgnum=prgnum+1
+       echo "==========> Eingabe von $i:"
+       cat $i
+       echo
+       echo "Ausgabe:"
+       $PROGRAM <$i
+       retval=$?
+       if test $retval -eq ${i#*.}
+       then
+               echo "Status: korrekt"
+       else
+               echo "[Error] Status: $retval. Erwartet: ${i#*.}"
+               let errnum=errnum+1
+               exit 3;
+       fi
+       echo
+fi
+done
+let corrnum=prgnum-errnum
+echo "Statistics: "
+echo "==========="
+echo "           $prgnum Tests total"
+echo "           $corrnum Tests passed"
+echo "           $errnum Tests failed"
index 676bd0e3b28a83f645e95183e2ef79f042b56cb1..dc33af2b470c4104b37c2a115f089e4b64ebb11b 100755 (executable)
@@ -5,7 +5,8 @@ beispiel=gesamt
 PROGRAM=./$beispiel
 
 #LOC=.
-LOC=/usr/ftp/pub/ubvl/test/$beispiel
+#LOC=/usr/ftp/pub/ubvl/test/$beispiel
+LOC=~/test/scripts
 
 allow_null_glob_expansion=1
 
diff --git a/scripts/onetest_gesamt_ppc b/scripts/onetest_gesamt_ppc
new file mode 100755 (executable)
index 0000000..8d35dd7
--- /dev/null
@@ -0,0 +1,116 @@
+#!/bin/bash
+
+i=$1
+beispiel=gesamt_ppc
+PROGRAM=./$beispiel
+
+#LOC=.
+#LOC=/usr/ftp/pub/ubvl/test/$beispiel
+LOC=~/test/scripts
+
+allow_null_glob_expansion=1
+
+if [ ! -d ~/abgabe/$beispiel ]; then
+  echo "Fehler: Verzeichnis ~/abgabe/$beispiel existiert nicht."
+  exit 1
+else
+  cd ~/abgabe/$beispiel
+  echo 'Teste "make"'
+  make
+fi
+
+if test ! -x $PROGRAM
+then
+       echo "Fehler: Kein Programm $PROGRAM"
+       exit 1
+fi
+let prgnum=0
+#for i in $LOC/*.0 $LOC2/*.0
+if [ -f $i ]; then
+       let prgnum=prgnum+1
+       let errorfound=0
+       echo "==========> Eingabe von $i:"
+       cat $i
+       echo
+       RESFILE=test${beispiel}out$$
+       $PROGRAM <$i >$RESFILE
+       retval=$?
+       echo -n "Übersetzung: "
+       if test $retval -eq 0
+       then
+               echo "Status korrekt"
+       else
+               echo "[Errot] Status=$retval. Erwartet: 0"
+               let errorfound=1
+       fi
+       echo
+       echo "Ausgabe:"
+       if [ -f ~/test/scripts/clr.py ]; then
+               cat $RESFILE | ~/test/scripts/clr.py
+       else
+               cat $RESFILE
+       fi
+       mv -f $RESFILE $RESFILE.s
+       CALLFILE=${i%.*}.call
+       echo
+       if [ ! -f $CALLFILE ]; then
+       echo "Fehler: Datei $CALLFILE existiert nicht, kann Code nicht ausführen..."
+       exit 1
+       else
+       echo "Übersetze und linke das Testprogramm:"
+       if cc -g -I. -DCALL=\"$CALLFILE\" $LOC/testmain.c $LOC/callingconvention.o $RESFILE.s; then
+               echo
+               echo "Rufe folgendes Codefragment auf:"
+               cat $CALLFILE
+               echo
+               ./a.out 
+               retval=$?
+               # test callee saved registers
+               if [ "$retval" -ge 12 ] && [ "$retval" -le 15 ]; then
+               echo "[Error] Callee-saved register %r$retval modified."
+                                       let errorfound=1
+               elif [ "$retval" -eq 11 ]; then
+               echo "[Error] Callee-saved register %rbx modified."
+                                       let errorfound=1
+               elif [ "$retval" -eq 16 ]; then
+               echo "[Error] Callee-saved register %rbp modified."
+                                       let errorfound=1
+               elif [ "$retval" -eq 30 ]; then
+               echo "[Error] Stack pointer %rsp modified."
+                                       let errorfound=1
+                               else
+                                       # test signals  
+               test $retval -gt 127
+               retsig=$?
+               test ${i##*.} = xin
+               expsig=$?
+               if test $retsig -eq $expsig; then
+                       if test $retval -eq 1; then
+                       echo "[Error] Das Ergebnis des Aufrufs ist falsch."
+                       let errorfound=1
+                       elif test $retval -eq 0; then
+                       echo "Das Ergebnis des Ausdrucks ist korrekt."
+                       else
+                               echo "[Error] Erzeugter Code verhaelt sich bzgl. Signalerzeugung anders als erwartet."
+                       let errorfound=1
+                       fi
+               else
+                       echo "[Error] Erzeugter Code verhaelt sich bezueglich Signalerzeugung anders als erwartet."
+                       let errorfound=1
+                       echo "Rueckgabewert = $retval";
+               fi
+               fi
+               echo
+       else
+               echo "[Error] Erzeugter Code konnte nicht assembliert und gelinkt werden."
+               let errorfound=1
+       fi
+       fi
+       let errnum=errnum+errorfound
+       if [ 1 -eq $errorfound ]; then
+               rm *.s
+               rm *.out
+               exit 3;
+       fi
+       rm -f a.out $RESFILE $RESFILE.s
+fi