summary refs log tree commit diff stats
path: root/tests/cpp/tthread_createthread.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cpp/tthread_createthread.nim')
-rw-r--r--tests/cpp/tthread_createthread.nim14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/cpp/tthread_createthread.nim b/tests/cpp/tthread_createthread.nim
new file mode 100644
index 000000000..0dc081268
--- /dev/null
+++ b/tests/cpp/tthread_createthread.nim
@@ -0,0 +1,14 @@
+discard """
+  cmd: "nim cpp --hints:on --threads:on $options $file"
+"""
+
+proc threadMain(a: int) {.thread.} =
+    discard
+
+proc main() =
+    var thread: TThread[int]
+
+    thread.createThread(threadMain, 0)
+    thread.joinThreads()
+
+main()
\ No newline at end of file