summaryrefslogtreecommitdiffstats
path: root/openmp/runtime
diff options
context:
space:
mode:
authorJonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>2016-08-04 14:55:56 +0000
committerJonas Hahnfeld <Hahnfeld@itc.rwth-aachen.de>2016-08-04 14:55:56 +0000
commitd1f4b8f6e8eb3d0f2459d78fa98eaef09a51b42b (patch)
tree9b1c91151f424397dc4dca687accb92279127cb1 /openmp/runtime
parent6b2a4d5e8f74b2fdbfc1567a7e81994f74891baf (diff)
downloadbcm5719-llvm-d1f4b8f6e8eb3d0f2459d78fa98eaef09a51b42b.tar.gz
bcm5719-llvm-d1f4b8f6e8eb3d0f2459d78fa98eaef09a51b42b.zip
Add test case for nested creation of tasks
For discussion in D23115 llvm-svn: 277730
Diffstat (limited to 'openmp/runtime')
-rw-r--r--openmp/runtime/test/tasking/nested_task_creation.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/openmp/runtime/test/tasking/nested_task_creation.c b/openmp/runtime/test/tasking/nested_task_creation.c
new file mode 100644
index 00000000000..c7c25fcddef
--- /dev/null
+++ b/openmp/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;
+}
OpenPOWER on IntegriCloud