summaryrefslogtreecommitdiff
path: root/libcr/tests/test_matrix.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcr/tests/test_matrix.c')
-rw-r--r--libcr/tests/test_matrix.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libcr/tests/test_matrix.c b/libcr/tests/test_matrix.c
new file mode 100644
index 0000000..eaa4bdc
--- /dev/null
+++ b/libcr/tests/test_matrix.c
@@ -0,0 +1,24 @@
+/* libcr/tests/test_matrix.c - Tests for libcr
+ *
+ * Copyright (C) 2024-2025 Luke T. Shumaker <lukeshu@lukeshu.com>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+#include <libcr/coroutine.h>
+
+int a = 1;
+
+COROUTINE init_cr(void *) {
+ cr_begin();
+ a = 2;
+ cr_end();
+}
+
+int main() {
+ coroutine_add("init", init_cr, NULL);
+ coroutine_main();
+ if (a != 2)
+ return 1;
+ coroutine_main();
+ return 0;
+}