about summary refs log tree commit diff stats
path: root/mu.arc.t
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-01-29 13:47:30 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-01-29 13:47:30 -0800
commitb9e75b5a498e11656fc320ea33c7e845d352b58e (patch)
tree5d4d6774ddfaa2fae4be271d43bc927cc13d9873 /mu.arc.t
parente2a5ae322ce5fec5b798a8c74eb0e72210934de1 (diff)
downloadmu-b9e75b5a498e11656fc320ea33c7e845d352b58e.tar.gz
677 - more improvements for names in shared spaces
Diffstat (limited to 'mu.arc.t')
-rw-r--r--mu.arc.t55
1 files changed, 54 insertions, 1 deletions
diff --git a/mu.arc.t b/mu.arc.t
index af4642a4..8761664e 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -1075,7 +1075,7 @@
 (push-stack routine* 'callee)  ; pretend call was at first instruction of caller
 (run-for-time-slice 1)
 (when (~is 1 pc.routine*)
-  (prn "F - 'reply' should increment pc in caller (to move past calling instruction)"))
+  (prn "F - 'reply' increments pc in caller (to move past calling instruction)"))
 
 (reset)
 (new-trace "new-fn-arg-sequential")
@@ -2278,6 +2278,59 @@
           (~is memory*.3 5))
   (prn "F - override names for the default space"))
 
+(reset)
+(new-trace "default-space-shared-with-extra-names")
+(add-code
+  '((function f [
+      (default-space:space-address <- new space:literal 30:literal)
+      (x:integer <- copy 3:literal)
+      (y:integer <- copy 4:literal)
+      (reply default-space:space-address)
+     ])
+    (function g [
+      (default-space:space-address/names:f <- next-input)
+      (y:integer <- add y:integer 1:literal)
+      (x:integer <- add x:integer 2:literal)
+      (z:integer <- add x:integer y:integer)
+      (reply z:integer)
+     ])
+    (function main [
+      (1:space-address <- f)
+      (2:integer <- g 1:space-address)
+     ])))
+(run 'main)
+(each routine completed-routines*
+  (aif rep.routine!error (prn "error - " it)))
+(when (~is memory*.2 10)
+  (prn "F - shared spaces can add new names"))
+
+(reset)
+(new-trace "default-space-shared-extra-names-dont-overlap-bindings")
+(add-code
+  '((function f [
+      (default-space:space-address <- new space:literal 30:literal)
+      (x:integer <- copy 3:literal)
+      (y:integer <- copy 4:literal)
+      (reply default-space:space-address)
+     ])
+    (function g [
+      (default-space:space-address/names:f <- next-input)
+      (y:integer <- add y:integer 1:literal)
+      (x:integer <- add x:integer 2:literal)
+      (z:integer <- copy 2:literal)
+      (reply x:integer y:integer)
+     ])
+    (function main [
+      (1:space-address <- f)
+      (2:integer <- g 1:space-address)
+     ])))
+(run 'main)
+(each routine completed-routines*
+  (aif rep.routine!error (prn "error - " it)))
+(when (or (~is memory*.2 5)
+          (~is memory*.3 5))
+  (prn "F - new names in shared spaces don't override old ones"))
+
 )  ; section 20
 
 (section 100