[WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349
[llvm-project.git] / flang / test / Semantics / omp-task01.f90
blob1206a889e8375ec241ba1924cd0c497509fc5027
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.
6 recursive subroutine traverse ( P )
7 type Node
8 type(Node), pointer :: left, right
9 end type Node
11 type(Node) :: P
13 !CHECK: invalid branch into an OpenMP structured block
14 goto 10
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
25 if (associated(P%right)) then
26 !$omp task
27 call traverse(P%right)
28 !$omp end task
29 endif
30 call process ( P )
32 end subroutine traverse