aboutsummaryrefslogtreecommitdiff
path: root/tests/threads/regression/recycle.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/threads/regression/recycle.zc')
-rw-r--r--tests/threads/regression/recycle.zc11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/threads/regression/recycle.zc b/tests/threads/regression/recycle.zc
new file mode 100644
index 0000000..4f0454a
--- /dev/null
+++ b/tests/threads/regression/recycle.zc
@@ -0,0 +1,11 @@
+namespace;
+include rt;
+unchecked fn main() {
+ int i = 0, total = 0;
+ while (i < 12) {
+ int fd = 0;
+ let context = rt.syscall(51, fn() { int value = i; rt.syscall(44, fd, &value, 1); return 0; } as word, &fd, 0);
+ int result = 0; rt.syscall(45, fd, &result, 1); total += result; rt.syscall(52, context, 0, 0); i++;
+ }
+ rt.put_n(total); rt.put_c(10); return 0;
+}