[flang-commits] [flang] [flang][OpenMP]Support for subroutine call for DECLARE REDUCTION init (PR #127889)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Mon Feb 24 12:17:16 PST 2025


================
@@ -1,5 +1,31 @@
 ! RUN: %flang_fc1 -fdebug-dump-symbols -fopenmp -fopenmp-version=50 %s | FileCheck %s
 
+!CHECK-LABEL: Subprogram scope: initme
+subroutine initme(x,n)
+  integer x,n
+  x=n
+end subroutine initme
+
+!CHECK-LABEL: Subprogram scope: func
+function func(x, n, init)
+  integer func
+  integer x(n)
+  integer res
+  interface
+     subroutine initme(x,n)
+       integer x,n
+     end subroutine initme
+  end interface
+  !$omp declare reduction(red_add:integer(4):omp_out=omp_out+omp_in) initializer(initme(omp_priv,0))
----------------
kiranchandramohan wrote:

Not for this patch. But I assume we would want to create symbols for omp_priv, omp_out, omp_in in their respective scopes to identify them due to their special meanings.

https://github.com/llvm/llvm-project/pull/127889


More information about the flang-commits mailing list