add test tests/flags/c-flag-determined-by-dc.test
authormegacz <adam@megacz.com>
Mon, 19 Jan 2009 02:29:39 +0000 (18:29 -0800)
committermegacz <adam@megacz.com>
Mon, 19 Jan 2009 02:29:39 +0000 (18:29 -0800)
tests/flags/c-flag-determined-by-dc.test [new file with mode: 0644]

diff --git a/tests/flags/c-flag-determined-by-dc.test b/tests/flags/c-flag-determined-by-dc.test
new file mode 100644 (file)
index 0000000..2dd6621
--- /dev/null
@@ -0,0 +1,63 @@
+// expected output
+#expect 1
+#expect 0
+#expect 0
+#expect 0
+#expect 1
+#expect 1
+#expect 0
+#expect 1
+
+#ship debug        : Debug
+#ship alu          : Alu
+#ship fifo         : Fifo
+
+alu.in1:
+  set word=1;
+  set ilc=*;
+  deliver;
+
+alu.inOp:
+  set word=Alu.inOp[CMP];
+  set ilc=*;
+  deliver;
+
+alu.out:
+  set flags a=0, b=0;
+  set olc=8;
+
+  head;
+  [!b] recv token, collect nothing;
+  [b]  recv token, collect word;
+  set flags a=c, b=b;
+  [!a] set word=0;
+  [a]  set word=1;
+  send to debug.in;
+  set olc--;
+  [d] abort;
+  set flags a=a, b=!b;
+  tail;
+
+debug.in:
+  set ilc=*;
+  recv, deliver;
+
+alu.in2:
+  set word=0;
+  set ilc=4;
+  deliver;
+  set word=1;
+  set ilc=4;
+  deliver;
+
+fifo.out:
+  send token to alu.out:1;
+  send token to alu.out:1;
+  send token to alu.out:0;
+  send token to alu.out:0;
+  send token to alu.out:1;
+  send token to alu.out:1;
+  send token to alu.out:0;
+  send token to alu.out:0;
+
+