aboutsummaryrefslogtreecommitdiff
path: root/tests/icon/reject/begin_unknown_function.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/icon/reject/begin_unknown_function.zc')
-rw-r--r--tests/icon/reject/begin_unknown_function.zc11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/icon/reject/begin_unknown_function.zc b/tests/icon/reject/begin_unknown_function.zc
new file mode 100644
index 0000000..6a8e5b3
--- /dev/null
+++ b/tests/icon/reject/begin_unknown_function.zc
@@ -0,0 +1,11 @@
+include rt;
+include run;
+include icon;
+fn main() {
+ // an address that is no function has no tokens to step: no frame, error status 4
+ let frame = icon.begin_function(12345);
+ rt.put_n(frame == 0); rt.put_c(' '); rt.put_n(icon.error()); rt.put_c(' ');
+ // stepping or reading a missing frame does nothing
+ rt.put_n(icon.step(0)); rt.put_c(10);
+ return 0;
+}