1! RUN: %python %S/../test_errors.py %s %flang -fopenmp
2
3use omp_lib
4  implicit none
5  integer :: xyz, abc
6  real :: reduction_var
7  !$omp parallel num_threads(4)
8    !$omp single
9      print *, "The"
10    !$omp taskgroup
11      !$omp task
12      print *, "almighty"
13      !$omp end task
14      !$omp task
15      print *, "sun"
16      !$omp end task
17    !$omp end taskgroup
18    !$omp end single
19  !$omp end parallel
20
21  !$omp parallel private(xyz)
22    !$omp taskgroup allocate(xyz)
23      !$omp task
24        print *, "The "
25        !$omp taskgroup allocate(omp_large_cap_mem_space: abc)
26          !$omp task
27          print *, "almighty sun"
28          !$omp end task
29        !$omp end taskgroup
30      !$omp end task
31    !$omp end taskgroup
32  !$omp end parallel
33
34  !ERROR: PRIVATE clause is not allowed on the TASKGROUP directive
35  !$omp taskgroup private(abc)
36  !$omp end taskgroup
37
38  !$omp parallel
39    !$omp task
40      !$omp taskgroup task_reduction(+ : reduction_var)
41          print *, "The "
42        !$omp taskgroup task_reduction(.or. : reduction_var) task_reduction(.and. : reduction_var)
43          print *, "almighty sun"
44        !$omp end taskgroup
45      !$omp end taskgroup
46    !$omp end task
47  !$omp end parallel
48end program