brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 115fe51 Raw
49 lines · plain
1! RUN: %flang_fc1 -fdebug-dump-symbols -fopenmp -fopenmp-version=50 %s | FileCheck %s2 3!! Test that we can "rename" an operator when using a module's operator.4module module15!CHECK:  Module scope: module1 size=06  implicit none7  type :: t18     real :: value9  end type t110  interface operator(.mul.)11     module procedure my_mul12  end interface operator(.mul.)13!CHECK: .mul., PUBLIC (Function): Generic DefinedOp procs: my_mul14!CHECK: my_mul, PUBLIC (Function): Subprogram result:TYPE(t1) r (TYPE(t1) x,TYPE(t1)15!CHECK: t1, PUBLIC: DerivedType components: value16contains17    function my_mul(x, y) result(r)18      type(t1), intent(in) :: x, y19      type(t1) :: r20      r%value = x%value * y%value21    end function my_mul22end module module123 24program test_omp_reduction25!CHECK: MainProgram scope: TEST_OMP_REDUCTION26  use module1, only: t1, operator(.modmul.) => operator(.mul.)27 28!CHECK: .modmul. (Function): Use from .mul. in module129  implicit none30 31  type(t1) :: result32  integer :: i33  !$omp declare reduction (.modmul. : t1 : omp_out = omp_out .modmul. omp_in) initializer(omp_priv = t1(1.0))34!CHECK: op.modmul.: UserReductionDetails TYPE(t1)35!CHECK: t1: Use from t1 in module136!CHECK: OtherConstruct scope: size=8 alignment=4 sourceRange=0 bytes37!CHECK: omp_in size=4 offset=0: ObjectEntity type: TYPE(t1)38!CHECK: omp_out size=4 offset=4: ObjectEntity type: TYPE(t1)39!CHECK: OtherConstruct scope: size=8 alignment=4 sourceRange=0 bytes40!CHECK: omp_orig size=4 offset=0: ObjectEntity type: TYPE(t1)41!CHECK: omp_priv size=4 offset=4: ObjectEntity type: TYPE(t1)42  result = t1(1.0)43  !$omp parallel do reduction(.modmul.:result)44  do i = 1, 1045     result = result .modmul. t1(real(i))46  end do47  !$omp end parallel do48end program test_omp_reduction49