xref: /llvm-project/flang/test/Lower/OpenMP/task_detach.f90 (revision edc50f3954af081b385cb03961899b5da1f1eb6b)
1! REQUIRES: openmp_runtime
2! RUN: %flang_fc1 -emit-fir %openmp_flags -fopenmp -fopenmp-version=50 -o - %s | FileCheck %s
3
4!===============================================================================
5! `detach` clause
6!===============================================================================
7
8!CHECK: omp.task detach(%[[EVENT_HANDLE:.*]] : !fir.ref<i64>) {
9!CHECK: fir.call @_QPfoo() fastmath<contract> : () -> ()
10!CHECK: omp.terminator
11!CHECK: }
12subroutine omp_task_detach()
13  use omp_lib
14  integer (kind=omp_event_handle_kind) :: event
15  !$omp task detach(event)
16  call foo()
17  !$omp end task
18end subroutine omp_task_detach
19