Test for OR
authorMartin Perner <martin@perner.cc>
Mon, 17 May 2010 20:56:27 +0000 (22:56 +0200)
committerMartin Perner <martin@perner.cc>
Mon, 17 May 2010 20:56:27 +0000 (22:56 +0200)
codea/skinner33_15.0 [new file with mode: 0644]
codea/skinner33_15.call [new file with mode: 0644]
codea/skinner33_15.instr [new file with mode: 0644]

diff --git a/codea/skinner33_15.0 b/codea/skinner33_15.0
new file mode 100644 (file)
index 0000000..5294f18
--- /dev/null
@@ -0,0 +1,37 @@
+struct foo bar end;
+
+method f1(a b)
+       return 4 or 5;
+end;
+
+method f2(a b)
+       return a.foo or 0x55555555;
+end;
+
+method f3(a b)
+       return 0x55555555 or b.bar;
+end;
+
+method f4(a b)
+       return (a.bar - b.foo) or (a.foo - b.bar);
+end;
+
+method f5(a b)
+       return (a.bar < b.foo) or this;
+end;
+
+method f6(a b)
+       return this or (b.bar =  a.foo);
+end;
+
+method f7(a b)
+       return a or b;
+end;
+
+method f8(a b)
+       return this or 0x112233;
+end;
+
+method f9(a b)
+       return 0x11EEEEFF or this;
+end;
diff --git a/codea/skinner33_15.call b/codea/skinner33_15.call
new file mode 100644 (file)
index 0000000..0cd43a9
--- /dev/null
@@ -0,0 +1,26 @@
+#define OR(a,b)     ((long)(a) | (long)(b))
+
+long f1(long, long*, long*);
+long f2(long, long*, long*);
+long f3(long, long*, long*);
+long f4(long, long*, long*);
+long f5(long, long*, long*);
+long f6(long, long*, long*);
+long f7(long, long*, long*);
+long f8(long, long*, long*);
+long f9(long, long*, long*);
+
+long muh[] = {0x05f05f, 0x223344};
+long kuh[] = {0x00AACC, 0x563425};
+
+RET(f1(5, muh, kuh) == OR(            4,             5) &&
+    f2(5, muh, kuh) == OR(       muh[0],    0x55555555) &&
+    f3(5, muh, kuh) == OR(   0x55555555,        kuh[1]) &&
+    f4(5, muh, kuh) == OR(muh[1]-kuh[0], muh[0]-kuh[1]) &&
+    f5(5, muh, kuh) == OR(            0,             5) &&
+    f6(5, muh, kuh) == OR(            5,             0) &&
+    f7(5, muh, kuh) == OR(          muh,           kuh) &&
+    f8(5, muh, kuh) == OR(            5,      0x112233) &&
+    f9(5, muh, kuh) == OR(   0x11EEEEFF,             5) 
+   );
+
diff --git a/codea/skinner33_15.instr b/codea/skinner33_15.instr
new file mode 100644 (file)
index 0000000..8f92bfd
--- /dev/null
@@ -0,0 +1 @@
+35