From d1f4b8f6e8eb3d0f2459d78fa98eaef09a51b42b Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Thu, 4 Aug 2016 14:55:56 +0000 Subject: [PATCH] Add test case for nested creation of tasks For discussion in D23115 llvm-svn: 277730 --- openmp/runtime/test/tasking/nested_task_creation.c | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 openmp/runtime/test/tasking/nested_task_creation.c 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 0000000..c7c25fc --- /dev/null +++ b/openmp/runtime/test/tasking/nested_task_creation.c @@ -0,0 +1,35 @@ +// RUN: %libomp-compile-and-run +#include +#include +#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; +} -- 2.7.4