diff options
Diffstat (limited to 'tests/threads/regression/resources_counts.zc')
| -rw-r--r-- | tests/threads/regression/resources_counts.zc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/threads/regression/resources_counts.zc b/tests/threads/regression/resources_counts.zc new file mode 100644 index 0000000..66cfc91 --- /dev/null +++ b/tests/threads/regression/resources_counts.zc @@ -0,0 +1,13 @@ +namespace; +include rt; +unchecked fn main() { + int closed = 0; + for (int i = 0; i < 24; i++) { + int fd = 0; + let context = rt.syscall(51, fn() { int value = 1; rt.syscall(44, fd, &value, 1); return 0; } as word, &fd, 0); + int result; rt.syscall(45, fd, &result, 1); rt.syscall(52, context, 0, 0); + closed += rt.syscall(44, fd, &result, 1) == -1; + } + rt.put_n(closed); rt.put_c(' '); rt.put_n(rt.syscall(55, 0, 0, 0)); rt.put_c(' '); + rt.put_n(rt.syscall(55, 1, 0, 0)); rt.put_c(' '); rt.put_n(rt.syscall(55, 2, 0, 0)); rt.put_c(10); return 0; +} |
