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-01 02:16:16 -0700
committerKartik K. Agaram <vc@akkartik.com>2014-11-01 02:16:16 -0700
commit990963b47033b6392531d5feaff71a064ddb787c (patch)
tree30c579e9344d29f20e88beef6deed143d36bd4be /mu.arc.t
parent4339b5d20697f4e9d1b8d02c19d68ef6bee0a827 (diff)
downloadmu-990963b47033b6392531d5feaff71a064ddb787c.tar.gz
197 - length of array pointer
Diffstat (limited to 'mu.arc.t')
-rw-r--r--mu.arc.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/mu.arc.t b/mu.arc.t
index 9d0fe7fb..5da21e91 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -538,6 +538,24 @@
 (if (~iso memory* (obj 1 2  2 23 3 nil  4 24 5 t  6 2))
   (prn "F - 'len' accesses length of array"))
 
+(reset)
+(new-trace "len-array-indirect")
+(add-fns
+  '((main
+      ((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 (1 literal))
+      ((7 integer) <- len (6 integer-boolean-pair-array-address deref)))))
+;? (set dump-trace*)
+;? (= dump-trace* (obj blacklist '("sz" "m" "setm" "addr" "cvt0" "cvt1")))
+(run 'main)
+;? (prn memory*)
+(if (~iso memory* (obj 1 2  2 23 3 nil  4 24 5 t  6 1  7 2))
+  (prn "F - 'len' accesses length of array address"))
+
 ; 'sizeof' is a helper to determine the amount of memory required by a type.
 
 (reset)