blob: d1a437be5664b6ce2137d86a7f888e6fcb6c65ff [file] [edit]
!RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=51 %s -o - | FileCheck %s --check-prefix=HLFIR
!RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 %s -o - | FileCheck %s --check-prefix=HLFIR
!RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=60 %s -o - | FileCheck %s --check-prefix=HLFIR
! Dispatch lowers to a no-op omp.dispatch region wrapping the associated call.
! Variant selection and the nocontext/novariants clauses are added separately;
! here the call inside the region targets the base procedure unchanged.
module funcs
implicit none
contains
!HLFIR-LABEL: func @_QMfuncsPfoo_dispatch
subroutine foo_dispatch()
print *, "in foo_dispatch"
end subroutine
end module funcs
!HLFIR-LABEL: func @_QQmain
program dispatch_test
use funcs
implicit none
!HLFIR: omp.dispatch {
!$omp dispatch
!HLFIR: fir.call @_QMfuncsPfoo_dispatch() {{.*}}: () -> ()
call foo_dispatch()
!HLFIR: omp.terminator
!HLFIR: }
!HLFIR: omp.dispatch nowait {
!$omp dispatch nowait
!HLFIR: fir.call @_QMfuncsPfoo_dispatch() {{.*}}: () -> ()
call foo_dispatch()
!HLFIR: omp.terminator
!HLFIR: }
end program