brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · e2645ba Raw
60 lines · plain
1! RUN: %flang_fc1 %openmp_flags -fopenmp-version=52 -fdebug-dump-parse-tree %s | FileCheck %s2! RUN: %flang_fc1 %openmp_flags -fdebug-unparse -fopenmp-version=52 %s | FileCheck %s --check-prefix="UNPARSE"3 4module functions5  implicit none6 7  interface8  function func() result(i)9    character(1) :: i10  end function11  end interface12 13contains14  function func1() result(i)15    !$omp declare target enter(func1) indirect(.true.)16    !CHECK:      OpenMPDeclarativeConstruct -> OpenMPDeclareTargetConstruct -> OmpDirectiveSpecification17    !CHECK-NEXT: | OmpDirectiveName -> llvm::omp::Directive = declare target18    !CHECK-NEXT: | OmpClauseList -> OmpClause -> Enter -> OmpEnterClause19    !CHECK-NEXT: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'func1'20    !CHECK-NEXT: | OmpClause -> Indirect -> OmpIndirectClause -> Scalar -> Logical -> Expr = '.true._4'21    !CHECK-NEXT: | | LiteralConstant -> LogicalLiteralConstant22    !CHECK-NEXT: | | | bool = 'true'23    !CHECK-NEXT: | Flags = {}24    character(1) :: i25    i = 'a'26    return27  end function28 29  function func2() result(i)30    !$omp declare target enter(func2) indirect31    !CHECK:      OpenMPDeclarativeConstruct -> OpenMPDeclareTargetConstruct -> OmpDirectiveSpecification32    !CHECK-NEXT: | OmpDirectiveName -> llvm::omp::Directive = declare target33    !CHECK-NEXT: | OmpClauseList -> OmpClause -> Enter -> OmpEnterClause34    !CHECK-NEXT: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'func2'35    !CHECK-NEXT: | OmpClause -> Indirect -> OmpIndirectClause ->36    !CHECK-NEXT: | Flags = {}37    character(1) :: i38    i = 'b'39    return40  end function41end module42 43program main44  use functions45  implicit none46  procedure (func), pointer :: ptr1=>func1, ptr2=>func247  character(1) :: val1, val248 49  !$omp target map(from: val1)50  val1 = ptr1()51  !$omp end target52  !$omp target map(from: val2)53  val2 = ptr2()54  !$omp end target55 56end program57 58!UNPARSE: !$OMP DECLARE TARGET ENTER(func1) INDIRECT(.true._4)59!UNPARSE: !$OMP DECLARE TARGET ENTER(func2) INDIRECT()60