aboutsummaryrefslogtreecommitdiff
path: root/final/runtime/test/tasking/nested_task_creation.c
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2019-03-18 12:53:32 +0000
committerHans Wennborg <hans@hanshq.net>2019-03-18 12:53:32 +0000
commitabdd46b7db373cb68b58d543400ceb178347b056 (patch)
tree04720549cebf68f6bd10f0009d01c340d7a65c9f /final/runtime/test/tasking/nested_task_creation.c
parent001d07557b8ffbecdb4f51536c1115f9bcba5ef1 (diff)
Creating release candidate final from release_800 branchsvn-tags/RELEASE_800
git-svn-id: https://llvm.org/svn/llvm-project/openmp/tags/RELEASE_800@356365 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'final/runtime/test/tasking/nested_task_creation.c')
-rw-r--r--final/runtime/test/tasking/nested_task_creation.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/final/runtime/test/tasking/nested_task_creation.c b/final/runtime/test/tasking/nested_task_creation.c
new file mode 100644
index 0000000..c7c25fc
--- /dev/null
+++ b/final/runtime/test/tasking/nested_task_creation.c
@@ -0,0 +1,35 @@
+// RUN: %libomp-compile-and-run
+#include <stdio.h>
+#include <omp.h>
+#include "omp_my_sleep.h"
+
+/*
+ * This test creates tasks that themselves create a new task.
+ * The runtime has to take care that they are correctly freed.
+ */
+
+int main()
+{
+ #pragma omp task
+ {
+ #pragma omp task
+ {
+ my_sleep( 0.1 );
+ }
+ }
+
+ #pragma omp parallel num_threads(2)
+ {
+ #pragma omp single
+ #pragma omp task
+ {
+ #pragma omp task
+ {
+ my_sleep( 0.1 );
+ }
+ }
+ }
+
+ printf("pass\n");
+ return 0;
+}