================
@@ -0,0 +1,39 @@
+! This test checks the lowering of the OpenMP INDIRECT clause when used with
the
+! DECLARE TARGET directive, together with an indirect call (through a procedure
+! pointer) from within a target region.
+
+! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 %s -o - | FileCheck
%s
+! RUN: %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52
-fopenmp-is-target-device %s -o - | FileCheck %s
+
+module functions
+ implicit none
+
+ interface
+ function func() result(i)
+ character(1) :: i
+ end function
+ end interface
+
+contains
+ ! CHECK: func.func @_QMfunctionsPfunc1({{.*}}attributes {omp.declare_target
= #omp.declaretarget<device_type = (any), capture_clause = (enter), automap =
false, indirect = true>}
+ function func1() result(i)
+ !$omp declare target enter(func1) indirect(.true.)
+ character(1) :: i
+ i = 'a'
+ return
+ end function
+end module
+
+program main
+ use functions
+ implicit none
+ procedure (func), pointer :: ptr1=>func1
+ character(1) :: val1
+
+ ! CHECK-LABEL: func.func @_QQmain()
+ ! CHECK: omp.target
----------------
blazie2004 wrote:
Added checks for the fir.load of the procedure pointer, the fir.box_addr
producing the callable address, and that address being the callee of the
fir.call.
https://github.com/llvm/llvm-project/pull/208387
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits