brintos

brintos / llvm-project-archived public Read only

0
0
Text · 12.4 KiB · a240271 Raw
271 lines · plain
1!RUN: %flang_fc1 -fdebug-unparse -fopenmp -fopenmp-version=52 %s | FileCheck --ignore-case --check-prefix="UNPARSE" %s2!RUN: %flang_fc1 -fdebug-dump-parse-tree -fopenmp -fopenmp-version=52 %s | FileCheck --check-prefix="PARSE-TREE" %s3 4!Directive specification where directives have arguments5 6subroutine f00(x)7  integer :: x(10)8  !$omp metadirective when(user={condition(.true.)}: &9  !$omp & allocate(x))10end11 12!UNPARSE: SUBROUTINE f00 (x)13!UNPARSE:  INTEGER x(10_4)14!UNPARSE: !$OMP METADIRECTIVE WHEN(USER={CONDITION(.true._4)}: ALLOCATE(x))15!UNPARSE: END SUBROUTINE16 17!PARSE-TREE: DeclarationConstruct -> SpecificationConstruct -> OpenMPDeclarativeConstruct -> OmpMetadirectiveDirective18!PARSE-TREE: | OmpClauseList -> OmpClause -> When -> OmpWhenClause19!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector20!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = User21!PARSE-TREE: | | | OmpTraitSelector22!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Condition23!PARSE-TREE: | | | | Properties24!PARSE-TREE: | | | | | OmpTraitProperty -> Scalar -> Expr = '.true._4'25!PARSE-TREE: | | | | | | LiteralConstant -> LogicalLiteralConstant26!PARSE-TREE: | | | | | | | bool = 'true'27!PARSE-TREE: | | OmpDirectiveSpecification28!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = allocate29!PARSE-TREE: | | | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'x'30!PARSE-TREE: | | | OmpClauseList ->31 32subroutine f01(x)33  integer :: x34  !$omp metadirective when(user={condition(.true.)}: &35  !$omp & critical(x))36end37 38!UNPARSE: SUBROUTINE f01 (x)39!UNPARSE:  INTEGER x40!UNPARSE: !$OMP METADIRECTIVE WHEN(USER={CONDITION(.true._4)}: CRITICAL(x))41!UNPARSE: END SUBROUTINE42 43!PARSE-TREE: DeclarationConstruct -> SpecificationConstruct -> OpenMPDeclarativeConstruct -> OmpMetadirectiveDirective44!PARSE-TREE: | OmpClauseList -> OmpClause -> When -> OmpWhenClause45!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector46!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = User47!PARSE-TREE: | | | OmpTraitSelector48!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Condition49!PARSE-TREE: | | | | Properties50!PARSE-TREE: | | | | | OmpTraitProperty -> Scalar -> Expr = '.true._4'51!PARSE-TREE: | | | | | | LiteralConstant -> LogicalLiteralConstant52!PARSE-TREE: | | | | | | | bool = 'true'53!PARSE-TREE: | | OmpDirectiveSpecification54!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = critical55!PARSE-TREE: | | | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'x'56!PARSE-TREE: | | | OmpClauseList ->57 58subroutine f0259  !$omp metadirective when(user={condition(.true.)}: &60  !$omp & declare mapper(mymapper : integer :: v) map(tofrom: v))61end62 63!UNPARSE: SUBROUTINE f0264!UNPARSE: !$OMP METADIRECTIVE WHEN(USER={CONDITION(.true._4)}: DECLARE MAPPER(mymapper:INTEGER::&65!UNPARSE: !$OMP&v) MAP(TOFROM: v))66!UNPARSE: END SUBROUTINE67 68!PARSE-TREE: OpenMPDeclarativeConstruct -> OmpMetadirectiveDirective69!PARSE-TREE: | OmpClauseList -> OmpClause -> When -> OmpWhenClause70!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector71!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = User72!PARSE-TREE: | | | OmpTraitSelector73!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Condition74!PARSE-TREE: | | | | Properties75!PARSE-TREE: | | | | | OmpTraitProperty -> Scalar -> Expr = '.true._4'76!PARSE-TREE: | | | | | | LiteralConstant -> LogicalLiteralConstant77!PARSE-TREE: | | | | | | | bool = 'true'78!PARSE-TREE: | | OmpDirectiveSpecification79!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = declare mapper80!PARSE-TREE: | | | OmpArgumentList -> OmpArgument -> OmpMapperSpecifier81!PARSE-TREE: | | | | string = 'mymapper'82!PARSE-TREE: | | | | TypeSpec -> IntrinsicTypeSpec -> IntegerTypeSpec ->83!PARSE-TREE: | | | | Name = 'v'84!PARSE-TREE: | | | OmpClauseList -> OmpClause -> Map -> OmpMapClause85!PARSE-TREE: | | | | Modifier -> OmpMapType -> Value = Tofrom86!PARSE-TREE: | | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'v'87!PARSE-TREE: | | | | bool = 'true'88!PARSE-TREE: ImplicitPart ->89 90subroutine f0391  type :: tt192    integer :: x93  endtype94  type :: tt295    real :: x96  endtype97  !$omp metadirective when(user={condition(.true.)}: &98  !$omp & declare reduction(+ : tt1, tt2 : omp_out%x = omp_in%x + omp_out%x))99end100 101!UNPARSE: SUBROUTINE f03102!UNPARSE:  TYPE :: tt1103!UNPARSE:   INTEGER :: x104!UNPARSE:  END TYPE105!UNPARSE:  TYPE :: tt2106!UNPARSE:   REAL :: x107!UNPARSE:  END TYPE108!UNPARSE: !$OMP METADIRECTIVE WHEN(USER={CONDITION(.true._4)}: DECLARE REDUCTION(+:tt1, tt2: omp&109!UNPARSE: !$OMP&_out%x = omp_in%x + omp_out%x))110!UNPARSE: END SUBROUTINE111 112!PARSE-TREE: DeclarationConstruct -> SpecificationConstruct -> OpenMPDeclarativeConstruct -> OmpMetadirectiveDirective113!PARSE-TREE: | OmpClauseList -> OmpClause -> When -> OmpWhenClause114!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector115!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = User116!PARSE-TREE: | | | OmpTraitSelector117!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Condition118!PARSE-TREE: | | | | Properties119!PARSE-TREE: | | | | | OmpTraitProperty -> Scalar -> Expr = '.true._4'120!PARSE-TREE: | | | | | | LiteralConstant -> LogicalLiteralConstant121!PARSE-TREE: | | | | | | | bool = 'true'122!PARSE-TREE: | | OmpDirectiveSpecification123!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = declare reduction124!PARSE-TREE: | | | OmpArgumentList -> OmpArgument -> OmpReductionSpecifier125!PARSE-TREE: | | | | OmpReductionIdentifier -> DefinedOperator -> IntrinsicOperator = Add126!PARSE-TREE: | | | | OmpTypeNameList -> OmpTypeName -> TypeSpec -> DerivedTypeSpec127!PARSE-TREE: | | | | | Name = 'tt1'128!PARSE-TREE: | | | | OmpTypeName -> TypeSpec -> DerivedTypeSpec129!PARSE-TREE: | | | | | Name = 'tt2'130!PARSE-TREE: | | | | OmpCombinerExpression -> OmpStylizedInstance131!PARSE-TREE: | | | | | OmpStylizedDeclaration132!PARSE-TREE: | | | | | OmpStylizedDeclaration133!PARSE-TREE: | | | | | Instance -> AssignmentStmt = 'omp_out%x=omp_in%x+omp_out%x'134!PARSE-TREE: | | | | | | Variable = 'omp_out%x'135!PARSE-TREE: | | | | | | | Designator -> DataRef -> StructureComponent136!PARSE-TREE: | | | | | | | | DataRef -> Name = 'omp_out'137!PARSE-TREE: | | | | | | | | Name = 'x'138!PARSE-TREE: | | | | | | Expr = 'omp_in%x+omp_out%x'139!PARSE-TREE: | | | | | | | Add140!PARSE-TREE: | | | | | | | | Expr = 'omp_in%x'141!PARSE-TREE: | | | | | | | | | Designator -> DataRef -> StructureComponent142!PARSE-TREE: | | | | | | | | | | DataRef -> Name = 'omp_in'143!PARSE-TREE: | | | | | | | | | | Name = 'x'144!PARSE-TREE: | | | | | | | | Expr = 'omp_out%x'145!PARSE-TREE: | | | | | | | | | Designator -> DataRef -> StructureComponent146!PARSE-TREE: | | | | | | | | | | DataRef -> Name = 'omp_out'147!PARSE-TREE: | | | | | | | | | | Name = 'x'148!PARSE-TREE: | | | | OmpStylizedInstance149!PARSE-TREE: | | | | | OmpStylizedDeclaration150!PARSE-TREE: | | | | | OmpStylizedDeclaration151!PARSE-TREE: | | | | | Instance -> AssignmentStmt = 'omp_out%x=omp_in%x+omp_out%x'152!PARSE-TREE: | | | | | | Variable = 'omp_out%x'153!PARSE-TREE: | | | | | | | Designator -> DataRef -> StructureComponent154!PARSE-TREE: | | | | | | | | DataRef -> Name = 'omp_out'155!PARSE-TREE: | | | | | | | | Name = 'x'156!PARSE-TREE: | | | | | | Expr = 'omp_in%x+omp_out%x'157!PARSE-TREE: | | | | | | | Add158!PARSE-TREE: | | | | | | | | Expr = 'omp_in%x'159!PARSE-TREE: | | | | | | | | | Designator -> DataRef -> StructureComponent160!PARSE-TREE: | | | | | | | | | | DataRef -> Name = 'omp_in'161!PARSE-TREE: | | | | | | | | | | Name = 'x'162!PARSE-TREE: | | | | | | | | Expr = 'omp_out%x'163!PARSE-TREE: | | | | | | | | | Designator -> DataRef -> StructureComponent164!PARSE-TREE: | | | | | | | | | | DataRef -> Name = 'omp_out'165!PARSE-TREE: | | | | | | | | | | Name = 'x'166!PARSE-TREE: | | | OmpClauseList ->167!PARSE-TREE: | | | Flags = {}168 169subroutine f04170  !$omp metadirective when(user={condition(.true.)}: &171  !$omp & declare simd(f04))172end173 174!UNPARSE: SUBROUTINE f04175!UNPARSE: !$OMP METADIRECTIVE WHEN(USER={CONDITION(.true._4)}: DECLARE SIMD(f04))176!UNPARSE: END SUBROUTINE177 178!PARSE-TREE: OpenMPDeclarativeConstruct -> OmpMetadirectiveDirective179!PARSE-TREE: | OmpClauseList -> OmpClause -> When -> OmpWhenClause180!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector181!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = User182!PARSE-TREE: | | | OmpTraitSelector183!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Condition184!PARSE-TREE: | | | | Properties185!PARSE-TREE: | | | | | OmpTraitProperty -> Scalar -> Expr = '.true._4'186!PARSE-TREE: | | | | | | LiteralConstant -> LogicalLiteralConstant187!PARSE-TREE: | | | | | | | bool = 'true'188!PARSE-TREE: | | OmpDirectiveSpecification189!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = declare simd190!PARSE-TREE: | | | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'f04'191!PARSE-TREE: | | | OmpClauseList ->192!PARSE-TREE: ImplicitPart ->193 194subroutine f05195  !$omp metadirective when(user={condition(.true.)}: &196  !$omp & declare target(f05))197end198 199!UNPARSE: SUBROUTINE f05200!UNPARSE: !$OMP METADIRECTIVE WHEN(USER={CONDITION(.true._4)}: DECLARE TARGET(f05))201!UNPARSE: END SUBROUTINE202 203!PARSE-TREE: OpenMPDeclarativeConstruct -> OmpMetadirectiveDirective204!PARSE-TREE: | OmpClauseList -> OmpClause -> When -> OmpWhenClause205!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector206!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = User207!PARSE-TREE: | | | OmpTraitSelector208!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Condition209!PARSE-TREE: | | | | Properties210!PARSE-TREE: | | | | | OmpTraitProperty -> Scalar -> Expr = '.true._4'211!PARSE-TREE: | | | | | | LiteralConstant -> LogicalLiteralConstant212!PARSE-TREE: | | | | | | | bool = 'true'213!PARSE-TREE: | | OmpDirectiveSpecification214!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = declare target215!PARSE-TREE: | | | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'f05'216!PARSE-TREE: | | | OmpClauseList ->217!PARSE-TREE: ImplicitPart ->218 219subroutine f06(x, y)220  integer :: x, y221  !$omp metadirective when(user={condition(.true.)}: &222  !$omp & flush(x, y))223end224 225!UNPARSE: SUBROUTINE f06 (x, y)226!UNPARSE:  INTEGER x, y227!UNPARSE: !$OMP METADIRECTIVE WHEN(USER={CONDITION(.true._4)}: FLUSH(x, y))228!UNPARSE: END SUBROUTINE229 230!PARSE-TREE: DeclarationConstruct -> SpecificationConstruct -> OpenMPDeclarativeConstruct -> OmpMetadirectiveDirective231!PARSE-TREE: | OmpClauseList -> OmpClause -> When -> OmpWhenClause232!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector233!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = User234!PARSE-TREE: | | | OmpTraitSelector235!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Condition236!PARSE-TREE: | | | | Properties237!PARSE-TREE: | | | | | OmpTraitProperty -> Scalar -> Expr = '.true._4'238!PARSE-TREE: | | | | | | LiteralConstant -> LogicalLiteralConstant239!PARSE-TREE: | | | | | | | bool = 'true'240!PARSE-TREE: | | OmpDirectiveSpecification241!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = flush242!PARSE-TREE: | | | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'x'243!PARSE-TREE: | | | | OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 'y'244!PARSE-TREE: | | | OmpClauseList ->245 246subroutine f07247  integer :: t248  !$omp metadirective when(user={condition(.true.)}: &249  !$omp & threadprivate(t))250end251 252!UNPARSE: SUBROUTINE f07253!UNPARSE:  INTEGER t254!UNPARSE: !$OMP METADIRECTIVE WHEN(USER={CONDITION(.true._4)}: THREADPRIVATE(t))255!UNPARSE: END SUBROUTINE256 257!PARSE-TREE: DeclarationConstruct -> SpecificationConstruct -> OpenMPDeclarativeConstruct -> OmpMetadirectiveDirective258!PARSE-TREE: | OmpClauseList -> OmpClause -> When -> OmpWhenClause259!PARSE-TREE: | | Modifier -> OmpContextSelectorSpecification -> OmpTraitSetSelector260!PARSE-TREE: | | | OmpTraitSetSelectorName -> Value = User261!PARSE-TREE: | | | OmpTraitSelector262!PARSE-TREE: | | | | OmpTraitSelectorName -> Value = Condition263!PARSE-TREE: | | | | Properties264!PARSE-TREE: | | | | | OmpTraitProperty -> Scalar -> Expr = '.true._4'265!PARSE-TREE: | | | | | | LiteralConstant -> LogicalLiteralConstant266!PARSE-TREE: | | | | | | | bool = 'true'267!PARSE-TREE: | | OmpDirectiveSpecification268!PARSE-TREE: | | | OmpDirectiveName -> llvm::omp::Directive = threadprivate269!PARSE-TREE: | | | OmpArgumentList -> OmpArgument -> OmpLocator -> OmpObject -> Designator -> DataRef -> Name = 't'270!PARSE-TREE: | | | OmpClauseList ->271