about summary refs log tree commit diff stats
path: root/cpp/032array
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-17 21:49:40 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-17 21:49:40 -0700
commit7b085072b8122450f64f4ffdb3be659bbf1fc684 (patch)
tree953335d90f4ced301f395884955ea65f0b1330ac /cpp/032array
parent0acfaaef6a402d332f2c1e83424e9d4d0ada7455 (diff)
downloadmu-7b085072b8122450f64f4ffdb3be659bbf1fc684.tar.gz
1089
Diffstat (limited to 'cpp/032array')
-rw-r--r--cpp/032array20
1 files changed, 20 insertions, 0 deletions
diff --git a/cpp/032array b/cpp/032array
index a4f5ecba..84ee4d38 100644
--- a/cpp/032array
+++ b/cpp/032array
@@ -25,6 +25,26 @@ recipe main [
 +mem: storing 15 in location 7
 +mem: storing 16 in location 8
 
+:(scenario copy_array_indirect)
+recipe main [
+  1:integer <- copy 3:literal
+  2:integer <- copy 14:literal
+  3:integer <- copy 15:literal
+  4:integer <- copy 16:literal
+  5:address:array:integer <- copy 1:literal
+  6:array:integer <- copy 5:address:array:integer/deref
+]
++run: instruction main/5
++run: ingredient 0 is 5
++mem: location 1 is 3
++mem: location 2 is 14
++mem: location 3 is 15
++mem: location 4 is 16
++mem: storing 3 in location 6
++mem: storing 14 in location 7
++mem: storing 15 in location 8
++mem: storing 16 in location 9
+
 //: disable the size mismatch check since the destination array need not be initialized
 :(replace "if (size_of(x) != data.size())" following "void write_memory(reagent x, vector<int> data)")
 if (x.types[0] != Type_number["array"] && size_of(x) != data.size())