aboutsummaryrefslogtreecommitdiff
path: root/tests/threads/accept/parallel.zc
diff options
context:
space:
mode:
Diffstat (limited to 'tests/threads/accept/parallel.zc')
-rw-r--r--tests/threads/accept/parallel.zc11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/threads/accept/parallel.zc b/tests/threads/accept/parallel.zc
new file mode 100644
index 0000000..567f829
--- /dev/null
+++ b/tests/threads/accept/parallel.zc
@@ -0,0 +1,11 @@
+namespace;
+include rt;
+unchecked fn main() {
+ int left_fd = 0, right_fd = 0;
+ let started = rt.syscall(50, 0, 0, 0);
+ let left = rt.syscall(51, fn() { int value = 11; rt.syscall(48, 300, 0, 0); rt.syscall(44, left_fd, &value, 1); return 0; } as word, &left_fd, 0);
+ let right = rt.syscall(51, fn() { int value = 21; rt.syscall(48, 300, 0, 0); rt.syscall(44, right_fd, &value, 1); return 0; } as word, &right_fd, 0);
+ int a, b; rt.syscall(45, left_fd, &a, 1); rt.syscall(45, right_fd, &b, 1);
+ rt.put_n(a); rt.put_c(' '); rt.put_n(b); rt.put_c(10); rt.put_n(rt.syscall(50, 0, 0, 0) - started); rt.put_c(10);
+ rt.syscall(52, left, 0, 0); rt.syscall(52, right, 0, 0); return 0;
+}