aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/102 threads/meson.build7
-rw-r--r--test cases/common/102 threads/threadprog.cpp14
2 files changed, 21 insertions, 0 deletions
diff --git a/test cases/common/102 threads/meson.build b/test cases/common/102 threads/meson.build
new file mode 100644
index 0000000..ca3eee5
--- /dev/null
+++ b/test cases/common/102 threads/meson.build
@@ -0,0 +1,7 @@
+project('threads', 'cpp')
+
+test('threadtest',
+ executable('threadprog', 'threadprog.cpp',
+ dependencies : dependency('threads')
+ )
+)
diff --git a/test cases/common/102 threads/threadprog.cpp b/test cases/common/102 threads/threadprog.cpp
new file mode 100644
index 0000000..9d140b3
--- /dev/null
+++ b/test cases/common/102 threads/threadprog.cpp
@@ -0,0 +1,14 @@
+#include<thread>
+#include<cstdio>
+
+void main_func() {
+ printf("Printing from a thread.\n");
+}
+
+int main(int, char**) {
+ printf("Starting thread.\n");
+ std::thread th(main_func);
+ th.join();
+ printf("Stopped thread.\n");
+ return 0;
+}