The DECLARE REDUCTION allows the initialization part to be either an expression or a call to a subroutine. This modifies the parsing and semantic analysis to allow the use of the subroutine, in addition to the simple expression that was already supported. New tests in parser and semantics sections check that the generated structure is as expected. DECLARE REDUCTION lowering is not yet implemented, so will end in a TODO. A new test with an init subroutine is added, that checks that this variant also ends with a "Not yet implemented" message.
12 lines
373 B
Fortran
12 lines
373 B
Fortran
! RUN: not %flang_fc1 -emit-obj -fopenmp -fopenmp-version=50 %s 2>&1 | FileCheck %s
|
|
|
|
subroutine initme(x,n)
|
|
integer x,n
|
|
x=n
|
|
end subroutine initme
|
|
|
|
subroutine subr
|
|
!$omp declare reduction(red_add:integer(4):omp_out=omp_out+omp_in) initializer(initme(omp_priv,0))
|
|
!CHECK: error: Implicit subroutine declaration 'initme' in !$OMP DECLARE REDUCTION
|
|
end subroutine subr
|