about summary refs log tree commit diff stats
path: root/mu.arc.t
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-11-04 13:46:31 -0800
committerKartik K. Agaram <vc@akkartik.com>2014-11-04 13:46:31 -0800
commitda2a15e7d3f3659d0eb06856364d7265a13ca628 (patch)
tree327397197be296710ad87824ad04d969286692d9 /mu.arc.t
parent76e562a862ec19114d5d2f88890121530cee1b64 (diff)
downloadmu-da2a15e7d3f3659d0eb06856364d7265a13ca628.tar.gz
225 - simple writes to channel
Diffstat (limited to 'mu.arc.t')
-rw-r--r--mu.arc.t17
1 files changed, 17 insertions, 0 deletions
diff --git a/mu.arc.t b/mu.arc.t
index 5f24ac81..08fb19b9 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -1717,4 +1717,21 @@
         (~is 0 (memory* (+ 1 memory*.1))))
   (prn "F - 'new-channel' initializes 'first-full and 'first-free to 0"))
 
+(reset)
+(new-trace "channel-write")
+(add-fns
+  '((main
+      ((1 channel-address) <- new-channel (3 literal))
+      ((2 integer-address) <- new (integer literal))
+      ((2 integer-address deref) <- copy (34 literal))
+      ((3 tagged-value-address) <- new-tagged-value (integer literal) (2 integer-address))
+      ((1 channel-address deref) <- write (1 channel-address deref) (3 tagged-value-address deref)))))
+;? (set dump-trace*)
+;? (= dump-trace* (obj blacklist '("sz" "m" "setm" "addr" "array-len" "cvt0" "cvt1")))
+(run 'main)
+;? (prn memory*)
+(if (or (~is 0 (memory* memory*.1))
+        (~is 1 (memory* (+ 1 memory*.1))))
+  (prn "F - 'write' enqueues item to channel"))
+
 (reset)  ; end file with this to persist the trace for the final test