aboutsummaryrefslogtreecommitdiff
path: root/tests/icon/accept/function_step.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/icon/accept/function_step.zc')
-rw-r--r--tests/icon/accept/function_step.zc12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/icon/accept/function_step.zc b/tests/icon/accept/function_step.zc
new file mode 100644
index 0000000..6bdf344
--- /dev/null
+++ b/tests/icon/accept/function_step.zc
@@ -0,0 +1,12 @@
+include rt;
+include run;
+include icon;
+int target(int value) { int n = value * 2; return n + 1; }
+fn main() {
+ let frame = icon.begin_function(target);
+ icon.set_local(frame, "value", 6);
+ icon.resume(frame, 8);
+ rt.put_n(icon.result(frame)); rt.put_c(' '); rt.put_n(target(2)); rt.put_c(10);
+ icon.close(d*frame);
+ return 0;
+}