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-07 00:59:23 -0800
committerKartik K. Agaram <vc@akkartik.com>2014-11-07 00:59:23 -0800
commitd430ce7c3d385fe7c057c0bde12fd0e4b5e6daff (patch)
treea1f29469d53df9492ee92b5c7d0952a31a4f8284 /mu.arc.t
parent0c62881a6f7adc4dfbeca243e44b585dc4cb40fe (diff)
downloadmu-d430ce7c3d385fe7c057c0bde12fd0e4b5e6daff.tar.gz
247
Diffstat (limited to 'mu.arc.t')
-rw-r--r--mu.arc.t33
1 files changed, 33 insertions, 0 deletions
diff --git a/mu.arc.t b/mu.arc.t
index 2a18fd86..29132a80 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -1869,4 +1869,37 @@
         (~is 1 memory*.7))
   (prn "F - 'read' dequeues item from channel"))
 
+(reset)
+(new-trace "channel-write-watch")
+(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-address literal) (2 integer-address))
+      ((4 boolean) <- get (1 channel-address deref) (read-watch offset))
+      ((1 channel-address deref) <- write (1 channel-address deref) (3 tagged-value-address deref))
+      ((5 boolean) <- get (1 channel-address deref) (write-watch offset)))))
+(run 'main)
+(if (or (~is nil memory*.4)
+        (~is t memory*.5))
+  (prn "F - 'write' sets channel watch"))
+
+(reset)
+(new-trace "channel-read-watch")
+(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-address literal) (2 integer-address))
+      ((1 channel-address deref) <- write (1 channel-address deref) (3 tagged-value-address deref))
+      ((4 boolean) <- get (1 channel-address deref) (read-watch offset))
+      ((5 tagged-value) (1 channel-address deref) <- read (1 channel-address deref))
+      ((6 integer) <- get (1 channel-address deref) (read-watch offset)))))
+(run 'main)
+(if (or (~is nil memory*.4)
+        (~is t memory*.6))
+  (prn "F - 'read' sets channel watch"))
+
 (reset)  ; end file with this to persist the trace for the final test