brintos

brintos / llvm-project-archived public Read only

0
0
Text · 9.2 KiB · 9f39066 Raw
260 lines · plain
1!RUN: %flang_fc1 -fdebug-unparse -fopenmp -fopenmp-version=60 %s -o - | FileCheck --check-prefix=UNPARSE %s2!RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp -fopenmp-version=60 %s -o - | FileCheck --check-prefix=PARSE-TREE %s3 4! The directives to check:5!   cancellation_point6!   declare_mapper7!   declare_reduction8!   declare_simd9!   declare_target10!   declare_variant11!   target_data12!   target_enter_data13!   target_exit_data14!   target_update15 16subroutine f0017  implicit none18  integer :: i19 20  !$omp parallel21  do i = 1, 1022    !$omp cancellation_point parallel23  enddo24  !$omp end parallel25end26 27!UNPARSE: SUBROUTINE f0028!UNPARSE:  IMPLICIT NONE29!UNPARSE:  INTEGER i30!UNPARSE: !$OMP PARALLEL31!UNPARSE:  DO i=1_4,10_432!UNPARSE: !$OMP CANCELLATION_POINT PARALLEL33!UNPARSE:  END DO34!UNPARSE: !$OMP END PARALLEL35!UNPARSE: END SUBROUTINE36 37!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OpenMPCancellationPointConstruct -> OmpDirectiveSpecification38!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = cancellation point39!PARSE-TREE: | OmpClauseList -> OmpClause -> CancellationConstructType -> OmpCancellationConstructTypeClause40!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = parallel41!PARSE-TREE: | Flags = {}42 43subroutine f0144  type :: t45    integer :: x46  end type47  !$omp declare_mapper(t :: v) map(v%x)48end49 50!UNPARSE: SUBROUTINE f0151!UNPARSE:  TYPE :: t52!UNPARSE:   INTEGER :: x53!UNPARSE:  END TYPE54!UNPARSE: !$OMP DECLARE_MAPPER(t::v) MAP(v%x)55!UNPARSE: END SUBROUTINE56 57!PARSE-TREE: DeclarationConstruct -> SpecificationConstruct -> OpenMPDeclarativeConstruct -> OpenMPDeclareMapperConstruct -> OmpDirectiveSpecification58!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = declare mapper59!PARSE-TREE: | OmpArgumentList -> OmpArgument -> OmpMapperSpecifier60!PARSE-TREE: | | string = 't_omp_default_mapper'61!PARSE-TREE: | | TypeSpec -> DerivedTypeSpec62!PARSE-TREE: | | | Name = 't'63!PARSE-TREE: | | Name = 'v'64!PARSE-TREE: | OmpClauseList -> OmpClause -> Map -> OmpMapClause65!PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> StructureComponent66!PARSE-TREE: | | | DataRef -> Name = 'v'67!PARSE-TREE: | | | Name = 'x'68!PARSE-TREE: | | bool = 'true'69!PARSE-TREE: | Flags = {}70 71subroutine f0272  type :: t73    integer :: x74  end type75  !$omp declare_reduction(+ : t : omp_out%x = omp_out%x + omp_in%x)76end77 78!UNPARSE: SUBROUTINE f0279!UNPARSE:  TYPE :: t80!UNPARSE:   INTEGER :: x81!UNPARSE:  END TYPE82!UNPARSE: !$OMP DECLARE_REDUCTION(+:t: omp_out%x = omp_out%x + omp_in%x)83!UNPARSE: END SUBROUTINE84 85!PARSE-TREE: DeclarationConstruct -> SpecificationConstruct -> OpenMPDeclarativeConstruct -> OpenMPDeclareReductionConstruct -> OmpDirectiveSpecification86!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = declare reduction87!PARSE-TREE: | OmpArgumentList -> OmpArgument -> OmpReductionSpecifier88!PARSE-TREE: | | OmpReductionIdentifier -> DefinedOperator -> IntrinsicOperator = Add89!PARSE-TREE: | | OmpTypeNameList -> OmpTypeName -> TypeSpec -> DerivedTypeSpec90!PARSE-TREE: | | | Name = 't'91!PARSE-TREE: | | OmpCombinerExpression -> OmpStylizedInstance92!PARSE-TREE: | | | OmpStylizedDeclaration93!PARSE-TREE: | | | OmpStylizedDeclaration94!PARSE-TREE: | | | Instance -> AssignmentStmt = 'omp_out%x=omp_out%x+omp_in%x'95!PARSE-TREE: | | | | Variable = 'omp_out%x'96!PARSE-TREE: | | | | | Designator -> DataRef -> StructureComponent97!PARSE-TREE: | | | | | | DataRef -> Name = 'omp_out'98!PARSE-TREE: | | | | | | Name = 'x'99!PARSE-TREE: | | | | Expr = 'omp_out%x+omp_in%x'100!PARSE-TREE: | | | | | Add101!PARSE-TREE: | | | | | | Expr = 'omp_out%x'102!PARSE-TREE: | | | | | | | Designator -> DataRef -> StructureComponent103!PARSE-TREE: | | | | | | | | DataRef -> Name = 'omp_out'104!PARSE-TREE: | | | | | | | | Name = 'x'105!PARSE-TREE: | | | | | | Expr = 'omp_in%x'106!PARSE-TREE: | | | | | | | Designator -> DataRef -> StructureComponent107!PARSE-TREE: | | | | | | | | DataRef -> Name = 'omp_in'108!PARSE-TREE: | | | | | | | | Name = 'x'109!PARSE-TREE: | OmpClauseList ->110!PARSE-TREE: | Flags = {}111 112subroutine f03113  !$omp declare_simd114end115 116!UNPARSE: SUBROUTINE f03117!UNPARSE: !$OMP DECLARE_SIMD118!UNPARSE: END SUBROUTINE119 120!PARSE-TREE: OpenMPDeclarativeConstruct -> OpenMPDeclareSimdConstruct -> OmpDirectiveSpecification121!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = declare simd122!PARSE-TREE: | OmpClauseList ->123!PARSE-TREE: | Flags = {}124 125subroutine f04126  !$omp declare_target127end128 129!UNPARSE: SUBROUTINE f04130!UNPARSE: !$OMP DECLARE_TARGET131!UNPARSE: END SUBROUTINE132 133!PARSE-TREE: OpenMPDeclarativeConstruct -> OpenMPDeclareTargetConstruct -> OmpDirectiveSpecification134!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = declare target135!PARSE-TREE: | OmpClauseList ->136!PARSE-TREE: | Flags = {}137 138subroutine f05139  implicit none140  interface141    subroutine g05142    end143  end interface144  !$omp declare_variant(g05) match(user={condition(.true.)})145end146 147!UNPARSE: SUBROUTINE f05148!UNPARSE:  IMPLICIT NONE149!UNPARSE:  INTERFACE150!UNPARSE:   SUBROUTINE g05151!UNPARSE:   END SUBROUTINE152!UNPARSE:  END INTERFACE153!UNPARSE: !$OMP DECLARE_VARIANT(g05) MATCH(USER={CONDITION(.true._4)})154!UNPARSE: END SUBROUTINE155 156!PARSE-TREE: DeclarationConstruct -> SpecificationConstruct -> OpenMPDeclarativeConstruct -> OmpDeclareVariantDirective -> OmpDirectiveSpecification157!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = declare variant158!PARSE-TREE: | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'g05'159!PARSE-TREE: | OmpClauseList -> OmpClause -> Match -> OmpMatchClause -> OmpContextSelectorSpecification -> OmpTraitSetSelector160!PARSE-TREE: | | OmpTraitSetSelectorName -> Value = User161!PARSE-TREE: | | OmpTraitSelector162!PARSE-TREE: | | | OmpTraitSelectorName -> Value = Condition163!PARSE-TREE: | | | Properties164!PARSE-TREE: | | | | OmpTraitProperty -> Scalar -> Expr = '.true._4'165!PARSE-TREE: | | | | | LiteralConstant -> LogicalLiteralConstant166!PARSE-TREE: | | | | | | bool = 'true'167!PARSE-TREE: | Flags = {}168 169subroutine f06170  implicit none171  integer :: i172  !$omp target_data map(tofrom: i)173  i = 0174  !$omp end target data175end176 177!UNPARSE: SUBROUTINE f06178!UNPARSE:  IMPLICIT NONE179!UNPARSE:  INTEGER i180!UNPARSE: !$OMP TARGET_DATA MAP(TOFROM: i)181!UNPARSE:   i=0_4182!UNPARSE: !$OMP END TARGET_DATA183!UNPARSE: END SUBROUTINE184 185!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OmpBlockConstruct186!PARSE-TREE: | OmpBeginDirective187!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = target data188!PARSE-TREE: | | OmpClauseList -> OmpClause -> Map -> OmpMapClause189!PARSE-TREE: | | | Modifier -> OmpMapType -> Value = Tofrom190!PARSE-TREE: | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'i'191!PARSE-TREE: | | | bool = 'true'192!PARSE-TREE: | Block193!PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> AssignmentStmt = 'i=0_4'194!PARSE-TREE: | | | Variable = 'i'195!PARSE-TREE: | | | | Designator -> DataRef -> Name = 'i'196!PARSE-TREE: | | | Expr = '0_4'197!PARSE-TREE: | | | | LiteralConstant -> IntLiteralConstant = '0'198!PARSE-TREE: | OmpEndDirective199!PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = target data200!PARSE-TREE: | | OmpClauseList ->201 202subroutine f07203  implicit none204  integer :: i205  !$omp target_enter_data map(to: i)206end207 208!UNPARSE: SUBROUTINE f07209!UNPARSE:  IMPLICIT NONE210!UNPARSE:  INTEGER i211!UNPARSE: !$OMP TARGET_ENTER_DATA MAP(TO: i)212!UNPARSE: END SUBROUTINE213 214!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OpenMPSimpleStandaloneConstruct -> OmpDirectiveSpecification215!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = target enter data216!PARSE-TREE: | OmpClauseList -> OmpClause -> Map -> OmpMapClause217!PARSE-TREE: | | Modifier -> OmpMapType -> Value = To218!PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'i'219!PARSE-TREE: | | bool = 'true'220!PARSE-TREE: | Flags = {}221 222subroutine f08223  implicit none224  integer :: i225  !$omp target_exit_data map(from: i)226end227 228!UNPARSE: SUBROUTINE f08229!UNPARSE:  IMPLICIT NONE230!UNPARSE:  INTEGER i231!UNPARSE: !$OMP TARGET_EXIT_DATA MAP(FROM: i)232!UNPARSE: END SUBROUTINE233 234!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OpenMPSimpleStandaloneConstruct -> OmpDirectiveSpecification235!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = target exit data236!PARSE-TREE: | OmpClauseList -> OmpClause -> Map -> OmpMapClause237!PARSE-TREE: | | Modifier -> OmpMapType -> Value = From238!PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'i'239!PARSE-TREE: | | bool = 'true'240!PARSE-TREE: | Flags = {}241 242subroutine f09243  implicit none244  integer :: i245  !$omp target_update to(i)246end247 248!UNPARSE: SUBROUTINE f09249!UNPARSE:  IMPLICIT NONE250!UNPARSE:  INTEGER i251!UNPARSE: !$OMP TARGET_UPDATE TO(i)252!UNPARSE: END SUBROUTINE253 254!PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPStandaloneConstruct -> OpenMPSimpleStandaloneConstruct -> OmpDirectiveSpecification255!PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = target update256!PARSE-TREE: | OmpClauseList -> OmpClause -> To -> OmpToClause257!PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'i'258!PARSE-TREE: | | bool = 'true'259!PARSE-TREE: | Flags = {}260