about summary refs log tree commit diff stats
path: root/cpp/027space
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/027space')
-rw-r--r--cpp/027space14
1 files changed, 14 insertions, 0 deletions
diff --git a/cpp/027space b/cpp/027space
index 7794db23..9d3ef572 100644
--- a/cpp/027space
+++ b/cpp/027space
@@ -71,3 +71,17 @@ int address(int offset, int base) {
 //?     cout << "AAA " << Current_routine.calls.top().default_space << '\n'; //? 1
     return;
   }
+
+:(scenario "get_default_space")
+recipe main [
+  default-space:address:space <- copy 10:literal
+  1:integer/raw <- copy default-space:address:space
+]
++mem: storing 10 in location 1
+
+:(after "vector<int> read_memory(reagent x)")
+  if (x.name == "default-space") {
+    vector<int> result;
+    result.push_back(Current_routine.calls.top().default_space);
+    return result;
+  }