about summary refs log tree commit diff stats
path: root/mu.arc.t
diff options
context:
space:
mode:
Diffstat (limited to 'mu.arc.t')
-rw-r--r--mu.arc.t14
1 files changed, 14 insertions, 0 deletions
diff --git a/mu.arc.t b/mu.arc.t
index 7487f57b..8f981315 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -1812,6 +1812,20 @@
 (if (~iso memory*.2 4)
   (prn "F - fork can pass args"))
 
+(reset)
+(new-trace "fork-copies-args")
+(add-fns
+  '((f1
+      ((default-scope scope-address) <- new (scope literal) (5 literal))
+      ((x integer) <- copy (4 literal))
+      (fork (f2 fn) (x integer))
+      ((x integer) <- copy (0 literal)))  ; should be ignored
+    (f2
+      ((2 integer) <- arg))))
+(run 'f1)
+(if (~iso memory*.2 4)
+  (prn "F - fork passes args by value"))
+
 ; The scheduler needs to keep track of the call stack for each routine.
 ; Eventually we'll want to save this information in mu's address space itself,
 ; along with the types array, the magic buffers for args and oargs, and so on.