From: unknown Date: Wed, 5 May 2010 08:15:08 +0000 (+0200) Subject: codea: lustige structs fuer codea X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=testub10.git;a=commitdiff_plain;h=c43b2d904c6886bbe1995e6ce065ef9de4f48e82 codea: lustige structs fuer codea --- diff --git a/codea/intelli_05.0 b/codea/intelli_05.0 new file mode 100644 index 0000000..a072dd1 --- /dev/null +++ b/codea/intelli_05.0 @@ -0,0 +1,11 @@ +struct x y z b end; + +method f(a b) + return b; +end; + +struct u v end; + +method g(a) + return u * a.v; +end; diff --git a/codea/intelli_05.call b/codea/intelli_05.call new file mode 100644 index 0000000..c2173d8 --- /dev/null +++ b/codea/intelli_05.call @@ -0,0 +1,14 @@ +extern long long f(long long*, long long*, long long); +extern long long g(long long*, long long*); + + +long long ar[10]; +long long ar2[10]; +int i = 1; +for(; i <= 10; i++) + ar[i-1] = i; +for (i = 1; i <= 10; i++) + ar2[i-1] = i * 10; + +RET(f(ar, ar, 4711) == 4711); +RET(g(ar, ar2) == 300); diff --git a/codea/intelli_06.0 b/codea/intelli_06.0 new file mode 100644 index 0000000..62d9d7e --- /dev/null +++ b/codea/intelli_06.0 @@ -0,0 +1,5 @@ +struct x y z end; + +method f() + return (x - y) * z; +end; diff --git a/codea/intelli_06.call b/codea/intelli_06.call new file mode 100644 index 0000000..42435f0 --- /dev/null +++ b/codea/intelli_06.call @@ -0,0 +1,9 @@ +extern long long f(long long*); + + +long long ar[10]; +int i = 1; +for(; i <= 10; i++) + ar[i-1] = i; + +RET(f(ar) == -3); diff --git a/codea/intelli_07.0 b/codea/intelli_07.0 new file mode 100644 index 0000000..0394e3c --- /dev/null +++ b/codea/intelli_07.0 @@ -0,0 +1,5 @@ +struct x y z end; + +method f(a) + return (a - (-3*8)).y; +end; diff --git a/codea/intelli_07.call b/codea/intelli_07.call new file mode 100644 index 0000000..1c49d3f --- /dev/null +++ b/codea/intelli_07.call @@ -0,0 +1,8 @@ +extern long long f(long long*, long long*); + +long long ar[10]; +int i = 1; +for(; i <= 10; i++) + ar[i-1] = i; + +RET(f(ar, ar) == 5); diff --git a/codea/intelli_08.0 b/codea/intelli_08.0 new file mode 100644 index 0000000..ca5e813 --- /dev/null +++ b/codea/intelli_08.0 @@ -0,0 +1,5 @@ +struct x y z end; + +method f(a) + return a.y - a.x - a.z; +end; diff --git a/codea/intelli_08.call b/codea/intelli_08.call new file mode 100644 index 0000000..2153dc3 --- /dev/null +++ b/codea/intelli_08.call @@ -0,0 +1,8 @@ +extern long long f(long long*, long long*); + +long long ar[10]; +int i = 1; +for(; i <= 10; i++) + ar[i-1] = i; + +RET(f(ar, ar) == -2);