From: Lukas Haselsteiner Date: Tue, 18 May 2010 11:26:03 +0000 (+0200) Subject: codeb (too) complex ifs and whiles X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=testub10.git;a=commitdiff_plain;h=211e4c6cc945ad6ecbeabbab5b0bcc332eba1e94 codeb (too) complex ifs and whiles --- diff --git a/codeb/intelli_14.0 b/codeb/intelli_14.0 new file mode 100644 index 0000000..b1b91cc --- /dev/null +++ b/codeb/intelli_14.0 @@ -0,0 +1,16 @@ +struct x end; + +method m(s) + var i := 0; + var sum := 0; + while i < s do + (this - (-8 * i)).x := (this - (-8 * i)).x * 10; + if (this - (-8 * i)).x = 47110 then + (this - (-8 * i)).x := 0815; + end; + sum := sum - ((this - (-8 * i)).x * -1); + i := i - (-1); + end; + return sum; +end; + diff --git a/codeb/intelli_14.call b/codeb/intelli_14.call new file mode 100644 index 0000000..d3fedd8 --- /dev/null +++ b/codeb/intelli_14.call @@ -0,0 +1,7 @@ +extern long long m(long long *this, long long s); + +long long ar[] = { 1, 2, 3, 4}; +long long ar2[] = { -7, 4711, 3, 4}; + +RET(m(ar, 3) == 60 && ar[0] == 10 && ar[1] == 20 && ar[2] == 30 && ar[3] == 4 +&& m(ar2, 2) == 745 && ar2[0] == -70 && ar2[1] == 815 && ar2[2] == 3); diff --git a/codeb/intelli_14.instr b/codeb/intelli_14.instr new file mode 100644 index 0000000..f937f7e --- /dev/null +++ b/codeb/intelli_14.instr @@ -0,0 +1 @@ +233 \ No newline at end of file diff --git a/codeb/intelli_15.0 b/codeb/intelli_15.0 new file mode 100644 index 0000000..7ed79aa --- /dev/null +++ b/codeb/intelli_15.0 @@ -0,0 +1,32 @@ +struct x end; + +method m1(size) + var x:= size - (-10); + x := (x * 0) - 20; + var i:= 0; + while not (i = size) do + if i < 1 then + (this - (i * -8)).x := (this - (i * -8)).x - (-20); + else + (this - (i * -8)).x := (this - ((i - 1) * -8)).x or 128; + end; + i := i - -1; + end; + return x; +end; + +method m2(y) + if 100 < y then + return 0; + end; + var x := -10; + while x < y do + x := x * -2; + end; + if y < 0 then + return -1 * x; + else + return 1 * x; + end; +end; + diff --git a/codeb/intelli_15.call b/codeb/intelli_15.call new file mode 100644 index 0000000..a004b8d --- /dev/null +++ b/codeb/intelli_15.call @@ -0,0 +1,7 @@ +extern long long m1(long long *this, long long size); +extern long long m2(long long this, long long y); + +long long ar[] = { 2, 4, 8, 16, 32 }; + +RET(m1(ar, 3) == -20 && ar[0] == 22 && ar[1] == 150 && ar[2] == 150 && +m2(0xABC, 101) == 0 && m2(0xABC, -5) == -20 && m2(0xABC, 100) == 320); \ No newline at end of file diff --git a/codeb/intelli_15.instr b/codeb/intelli_15.instr new file mode 100644 index 0000000..b3b2268 --- /dev/null +++ b/codeb/intelli_15.instr @@ -0,0 +1 @@ +228 \ No newline at end of file