66 lines · plain
1! RUN: %python %S/../test_modfile.py %s %flang_fc1 -fopenmp -fopenmp-version=522! Check correct modfile generation for OpenMP DECLARE REDUCTION construct.3 4!Expect: drm.mod5!module drm6!type::t17!integer(4)::val8!endtype9!!$OMP DECLARE REDUCTION(*:t1: omp_out=omp_out*omp_in) INITIALIZER(omp_priv=t1(&10!!$OMP&1))11!!$OMP METADIRECTIVE OTHERWISE(DECLARE REDUCTION(+:INTEGER))12!!$OMP DECLARE REDUCTION(.fluffy.:t1: omp_out=omp_out.fluffy.omp_in) INITIALIZE&13!!$OMP&R(omp_priv=t1(0))14!!$OMP DECLARE REDUCTION(.mul.:t1: omp_out=omp_out.mul.omp_in) INITIALIZER(omp_&15!!$OMP&priv=t1(1))16!interface operator(.mul.)17!procedure::mul18!end interface19!interface operator(.fluffy.)20!procedure::add21!end interface22!interface operator(*)23!procedure::mul24!end interface25!contains26!function mul(v1,v2)27!type(t1),intent(in)::v128!type(t1),intent(in)::v229!type(t1)::mul30!end31!function add(v1,v2)32!type(t1),intent(in)::v133!type(t1),intent(in)::v234!type(t1)::add35!end36!end37 38module drm39 type t140 integer :: val41 end type t142 interface operator(.mul.)43 procedure mul44 end interface45 interface operator(.fluffy.)46 procedure add47 end interface48 interface operator(*)49 module procedure mul50 end interface51!$omp declare reduction(*:t1:omp_out=omp_out*omp_in) initializer(omp_priv=t1(1))52!$omp declare reduction(.mul.:t1:omp_out=omp_out.mul.omp_in) initializer(omp_priv=t1(1))53!$omp declare reduction(.fluffy.:t1:omp_out=omp_out.fluffy.omp_in) initializer(omp_priv=t1(0))54!$omp metadirective otherwise(declare reduction(+: integer))55contains56 type(t1) function mul(v1, v2)57 type(t1), intent (in):: v1, v258 mul%val = v1%val * v2%val59 end function60 type(t1) function add(v1, v2)61 type(t1), intent (in):: v1, v262 add%val = v1%val + v2%val63 end function64end module drm65 66