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.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/cpp/tthread_createthread.nim b/tests/cpp/tthread_createthread.nim
new file mode 100644
index 000000000..b46b876b7
--- /dev/null
+++ b/tests/cpp/tthread_createthread.nim
@@ -0,0 +1,15 @@
+discard """
+  targets: "cpp"
+  cmd: "nim cpp --hints:on --threads:on $options $file"
+"""
+
+proc threadMain(a: int) {.thread.} =
+    discard
+
+proc main() =
+    var thread: Thread[int]
+
+    thread.createThread(threadMain, 0)
+    thread.joinThreads()
+
+main()