diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2014-11-29 01:03:32 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2014-11-29 01:04:27 -0800 |
commit | 725744100d994d70f8934ff5e95306edab5d920e (patch) | |
tree | add758fde2c762ccc4deba5874bc3c7201e453f4 /mu.arc.t | |
parent | ba7e56926df02be575ba772c33c8e1614f13f1f8 (diff) | |
download | mu-725744100d994d70f8934ff5e95306edab5d920e.tar.gz |
380
A test attempted earlier that now passes from free. Might as well keep it.
Diffstat (limited to 'mu.arc.t')
-rw-r--r-- | mu.arc.t | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mu.arc.t b/mu.arc.t index 40a2ff64..9674641a 100644 --- a/mu.arc.t +++ b/mu.arc.t @@ -1916,6 +1916,27 @@ (prn "F - indirect array copy in the presence of 'default-scope'")) ;? (quit) +(reset) +(new-trace "len-array-indirect-scoped") +(add-code + '((def main [ + ((10 integer) <- copy (30 literal)) ; pretend allocation + ((default-scope scope-address) <- copy (10 literal)) ; unsafe + ((1 integer) <- copy (2 literal)) + ((2 integer) <- copy (23 literal)) + ((3 boolean) <- copy (nil literal)) + ((4 integer) <- copy (24 literal)) + ((5 boolean) <- copy (t literal)) + ((6 integer-address) <- copy (11 literal)) ; unsafe + ((7 integer) <- len (6 integer-boolean-pair-array-address deref)) + ]))) +;? (= dump-trace* (obj whitelist '("run" "addr" "sz" "array-len"))) +(run 'main) +;? (prn memory*) +(if (~iso memory*.17 2) + (prn "F - 'len' accesses length of array address")) +;? (quit) + ;; Dynamic dispatch ; ; Putting it all together, here's how you define generic functions that run |