From 2f19a55f8a2893fba8b99cbbc24d50d8565c33a5 Mon Sep 17 00:00:00 2001 From: Martin Perner Date: Wed, 9 Jun 2010 21:12:21 +0200 Subject: [PATCH] [gesamt] two new testcases --- gesamt/skinner33_02.0 | 29 +++++++++++++++++++++++++++++ gesamt/skinner33_02.call | 21 +++++++++++++++++++++ gesamt/skinner33_02.instr | 1 + gesamt/skinner33_03.0 | 30 ++++++++++++++++++++++++++++++ gesamt/skinner33_03.call | 10 ++++++++++ gesamt/skinner33_03.instr | 1 + 6 files changed, 92 insertions(+) create mode 100644 gesamt/skinner33_02.0 create mode 100644 gesamt/skinner33_02.call create mode 100644 gesamt/skinner33_02.instr create mode 100644 gesamt/skinner33_03.0 create mode 100644 gesamt/skinner33_03.call create mode 100644 gesamt/skinner33_03.instr diff --git a/gesamt/skinner33_02.0 b/gesamt/skinner33_02.0 new file mode 100644 index 0000000..aada129 --- /dev/null +++ b/gesamt/skinner33_02.0 @@ -0,0 +1,29 @@ +struct a b c d 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; + +method m(ar) + 5; + 20 - ar.inc() - 70; + inc(); + ar.inc(); + 20 * inc(); + 20 * (5 - 4 - (4 * ((5 or 6) < ar.inc()))); + inc() * 20; + (((ar.inc() < (5 or 6)) *4) - 4 - 5) * 20; + + 15 * (ar.inc() < (5 -inc())); + ar.inc() < inc(); + + inc(4-5); + (((ar.inc(4-5,6*4,5<5) < (5 or 6)) *4) - 4 - 5) * 20; + return 0; +end; + + diff --git a/gesamt/skinner33_02.call b/gesamt/skinner33_02.call new file mode 100644 index 0000000..5de0e00 --- /dev/null +++ b/gesamt/skinner33_02.call @@ -0,0 +1,21 @@ +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; + + +/* based on intelli_03 */ + +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); + +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 == 0 && z1[0] == 0 && z2[0] == 10 && z1[1] == 8 && z1[2] == 10 && z1[3] == 12 && z1[4] == 14 && z1[5] == 10 && z1[6] == 12 && z2[1] == 27 && z2[2] == 47 && z2[3] == 67 && z2[4] == 87 && z2[5] == 100 && z2[6] == 120); diff --git a/gesamt/skinner33_02.instr b/gesamt/skinner33_02.instr new file mode 100644 index 0000000..c5356ba --- /dev/null +++ b/gesamt/skinner33_02.instr @@ -0,0 +1 @@ +174 diff --git a/gesamt/skinner33_03.0 b/gesamt/skinner33_03.0 new file mode 100644 index 0000000..78e41f2 --- /dev/null +++ b/gesamt/skinner33_03.0 @@ -0,0 +1,30 @@ +struct a end; + +method m1() + var x := 5; + + return x - g(); + + return x; +end; + +method m2() + var x := 5; + + return g() - x; + + return x; +end; + +method m3() + var n := in(); + return 3; +end; + +method in() + a := a - (-1); +end; + +method g() + return 2; +end; diff --git a/gesamt/skinner33_03.call b/gesamt/skinner33_03.call new file mode 100644 index 0000000..ff95053 --- /dev/null +++ b/gesamt/skinner33_03.call @@ -0,0 +1,10 @@ +long m1(long); +long m2(long); +long m3(long*); + +long a[] = {1}; +long ret; + +ret = m3(a); + +RET(m1(42) == 3 && m2(42) == -3 && 3 == ret && 2 == a[0]); diff --git a/gesamt/skinner33_03.instr b/gesamt/skinner33_03.instr new file mode 100644 index 0000000..425151f --- /dev/null +++ b/gesamt/skinner33_03.instr @@ -0,0 +1 @@ +40 -- 2.25.1