Debian Codegraph @

openmp/runtime/test/tasking/nested_task_creation.c

raw
1 // RUN: %libomp-compile-and-run
2 #include <stdio.h>
3 #include <omp.h>
4 #include "omp_my_sleep.h"
5
6 /*
7 * This test creates tasks that themselves create a new task.
8 * The runtime has to take care that they are correctly freed.
9 */
10
11 int main()
12 {
13 #pragma omp task
14 {
15 #pragma omp task
16 {
17 my_sleep( 0.1 );
18 }
19 }
20
21 #pragma omp parallel num_threads(2)
22 {
23 #pragma omp single
24 #pragma omp task
25 {
26 #pragma omp task
27 {
28 my_sleep( 0.1 );
29 }
30 }
31 }
32
33 printf("pass\n");
34 return 0;
35 }