1! RUN: not %flang -fsyntax-only -fopenmp %s 2>&1 | FileCheck %s
2! OpenMP Version 4.5
3! 2.9.1 task Construct
4! Invalid entry to OpenMP structured block.
5
6recursive subroutine traverse ( P )
7  type Node
8    type(Node), pointer :: left, right
9  end type Node
10
11  type(Node) :: P
12
13  !CHECK: invalid branch into an OpenMP structured block
14  goto 10
15
16  if (associated(P%left)) then
17    !$omp task
18    call traverse(P%left)
19    !CHECK: In the enclosing TASK directive branched into
20    !CHECK: STOP statement is not allowed in a TASK construct
21    10 stop
22    !$omp end task
23  endif
24
25  if (associated(P%right)) then
26    !$omp task
27    call traverse(P%right)
28    !$omp end task
29    endif
30  call process ( P )
31
32 end subroutine traverse
33